CSES - Datatähti Open 2021 - Results
Submission details
Task:Greater Integers
Sender:Edith123
Submission time:2021-01-31 12:08:09 +0200
Language:C++ (C++11)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1--1, 2details
#2--2details

Code

#include <iostream>
using namespace std;

int main() {
  long long t,n,maxi,k;
  cin >> t;
  for (long long i = 0; i < t; t++) {
    cin >> n;
    n += 1;
    maxi = 0;
    k = 1;
    while (n > 9) {
      k += 1;
      maxi = max(maxi,n % 10);
      n = n/10;
    }
    if (n < maxi) {
      n += 1;
    }
    for (long long j = 0; j < k; j++) {
      cout << n;
    }
    cout << endl;
  }
}

Test details

Test 1

Group: 1, 2

Verdict:

input
1000
1
2
3
4
...

correct output
2
3
4
5
6
...

user output
(empty)

Test 2

Group: 2

Verdict:

input
1000
735425311146082632
756615631808964686
466489470801941584
100417544394053220
...

correct output
777777777777777777
777777777777777777
555555555555555555
111111111111111111
555555555555555555
...

user output
(empty)