CSES - Datatähti Open 2021 - Results
Submission details
Task:Greater Integers
Sender:StandardTurtle
Submission time:2021-01-29 19:11:46 +0200
Language:C++17
Status:READY
Result:35
Feedback
groupverdictscore
#1ACCEPTED35
#20
Test results
testverdicttimegroup
#1ACCEPTED0.04 s1, 2details
#2--2details

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
...

Test 2

Group: 2

Verdict:

input
1000
735425311146082632
756615631808964686
466489470801941584
100417544394053220
...

correct output
777777777777777777
777777777777777777
555555555555555555
111111111111111111
555555555555555555
...

user output
(empty)