CSES - Datatähti 2021 loppu - Results
Submission details
Task:Suuremmat
Sender:Guuber
Submission time:2021-01-23 16:11:56 +0200
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.01 s1, 2details
#20.01 s2details

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:22:14: warning: unused variable 'u' [-Wunused-variable]
     for(auto u : ve){
              ^
input/code.cpp:27:14: warning: unused variable 'u' [-Wunused-variable]
     for(auto u : ve){
              ^
input/code.cpp:34:15: warning: unused variable 'u' [-Wunused-variable]
      for(auto u : ve){
               ^
input/code.cpp:39:15: warning: unused variable 'u' [-Wunused-variable]
      for(auto u : ve){
               ^
input/code.cpp:46:13: warning: unused variable 'u' [-Wunused-variable]
    for(auto u : ve){
             ^

Code

#include<bits/stdc++.h>
using namespace std;

int main(){
	int t;
	cin >> t;
	while(t--){
		string s;
		cin >> s;
		vector<int> ve = {};
		for(auto u : s){
			ve.push_back(u-'0');
		}
		bool bo = false;
		bool bo1 = false;
		for(auto u : ve){
			if(u > ve[0]) bo = true;
			if(u < ve[0]) bo1 = true;
		}
		if(bo){
			if(ve[0] == 9){
				for(auto u : ve){
					cout << 1;
				}
				cout << 1 << "\n";
			}else{
				for(auto u : ve){
					cout << ve[0]+1;
				}
			}
		}else{
			if(!bo1){
				if(ve[0] == 9){
					for(auto u : ve){
						cout << 1;
					}
					cout << 1 << "\n";
				}else{
					for(auto u : ve){
						cout << ve[0]+1;
					}
					cout << "\n";
				}
			}
			else{
			for(auto u : ve){
					cout << ve[0];
				}
				cout << "\n";
			}
		}
	}
}

Test details

Test 1

Group: 1, 2

Verdict:

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:

input
1000
735425311146082632
756615631808964686
466489470801941584
100417544394053220
...

correct output
777777777777777777
777777777777777777
555555555555555555
111111111111111111
555555555555555555
...

user output
888888888888888888888888888888...
Truncated