| Task: | Greater Integers |
| Sender: | andr1y |
| Submission time: | 2021-01-30 11:55:21 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 100 |
| group | verdict | score |
|---|---|---|
| #1 | ACCEPTED | 35 |
| #2 | ACCEPTED | 65 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.01 s | 1, 2 | details |
| #2 | ACCEPTED | 0.01 s | 2 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:31:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
for(ll i = 0;i<=n;i++) cout<<1;cout<<'\n';
^~~
input/code.cpp:31:40: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
for(ll i = 0;i<=n;i++) cout<<1;cout<<'\n';
^~~~Code
// -- //
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N = 1e5+228;
signed main(){
cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);
ll q;
cin >> q;
while(q--){
string s;
cin >> s;
ll s0 = s[0]-'0';
ll n = s.length();
bool ok =1, ol=0;
for(ll i = 1;i<n;i++){
if(s[i]-'0'>s0) ok=0;
if(s[i]-'0'<s0) {ol=1;break;}
}
if(ok&&ol){
for(ll i =0 ;i<n;i++) cout<<s0;
cout<<'\n';
continue;
}
if(s0<9){
for(ll i =0 ;i<n;i++) cout<<s0+1;
cout<<'\n';
continue;
}
for(ll i = 0;i<=n;i++) cout<<1;cout<<'\n';
}
}
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: ACCEPTED
| input |
|---|
| 1000 735425311146082632 756615631808964686 466489470801941584 100417544394053220 ... |
| correct output |
|---|
| 777777777777777777 777777777777777777 555555555555555555 111111111111111111 555555555555555555 ... |
| user output |
|---|
| 777777777777777777 777777777777777777 555555555555555555 111111111111111111 55555555555555 ... Truncated |
