| Task: | Greater Integers |
| Sender: | StandardTurtle |
| Submission time: | 2021-01-29 19:11:46 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 35 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 35 |
| #2 | TIME LIMIT EXCEEDED | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.04 s | 1, 2 | details |
| #2 | TIME LIMIT EXCEEDED | -- | 2 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:21:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j = 1; j<skaicius.length(); j++) {
~^~~~~~~~~~~~~~~~~~Code
#include <bits/stdc++.h>
#include <string>
#include <sstream>
using namespace std;
int main(){
int t, n;
cin >> t;
int atsakymai [n];
for(int i = 0; i<t; i++) {
cin >> n;
while (true) {
n++;
string skaicius;
stringstream ss;
ss << n;
ss >> skaicius;
bool arTinka = true;
for(int j = 1; j<skaicius.length(); j++) {
if (skaicius[j] != skaicius[j-1]) arTinka = false;
}
if (arTinka) {
atsakymai[i] = n;
break;
}
}
}
//cout << endl;
for(int i=0; i<t; i++) {
cout << atsakymai[i] << endl;
}
//cout << "Programos pabaiga" << endl;
}
Test details
Test 1
Group: 1, 2
Verdict: ACCEPTED
| input |
|---|
| 1000 1 2 3 4 ... |
| correct output |
|---|
| 2 3 4 5 6 ... |
| user output |
|---|
| 2 3 4 5 6 ... Truncated |
Test 2
Group: 2
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 1000 735425311146082632 756615631808964686 466489470801941584 100417544394053220 ... |
| correct output |
|---|
| 777777777777777777 777777777777777777 555555555555555555 111111111111111111 555555555555555555 ... |
| user output |
|---|
| (empty) |
