Task: | Greater Integers |
Sender: | dusty_sky |
Submission time: | 2021-01-30 17:56:38 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2 | details |
#2 | WRONG ANSWER | 0.01 s | 2 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:48:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<=ss.size();i++)cout<<1; ~^~~~~~~~~~~ input/code.cpp:54:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<ss.size();i++){ ~^~~~~~~~~~ input/code.cpp:67:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<ss.size();i++)cout<<zx; ~^~~~~~~~~~
Code
#include<bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> using namespace std; using namespace __gnu_pbds; #define T true #define F false #define fi first #define endl "\n" #define se second #define DIM 100001 #define pb push_back #define amen exit(0); #define qwe return 0; #define eps 0.0000001 #define mod 1000000007 #define INF 1000000000001 #define gg cout<<"OPS"<<endl; #define PI 3.1415926535897932384626433 #define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0); #define time cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n"; typedef char ch; typedef bool boll; typedef string st; typedef long long ll; typedef long double ld; typedef set < string > sst; typedef set < long long > sll; typedef unsigned long long ull; typedef queue < long long > que; typedef deque < long long > deq; typedef vector < long long > vec; typedef map < long long, long long > mll; typedef pair < long long, long long > pll; typedef pair < long long, unsigned long long > pul; typedef vector < pair < long long, long long > > vpl; typedef tree <ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> myset; ll n,z,x,s; int main() { fast; ll t; cin>>t; while(t--){ st ss; cin>>ss; if(ss[0]=='9' && ss.size()==1){ for(int i=0;i<=ss.size();i++)cout<<1; cout<<endl; } else{ ll zx=ss[0]-'0'; int x1=0,x2=0; for(int i=0;i<ss.size();i++){ if(ss[i]-'0'<zx) x1=1; else x2=1; } if(x1==0){ if(zx==9)zx=1,ss+=zx+'0'; else zx++; } else if(x1==1 && x2==1){ if(zx==9)zx=1,ss+=zx+'0'; else zx++; } for(int i=0;i<ss.size();i++)cout<<zx; cout<<endl; } } //time; }
Test details
Test 1
Group: 1, 2
Verdict: WRONG ANSWER
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: WRONG ANSWER
input |
---|
1000 735425311146082632 756615631808964686 466489470801941584 100417544394053220 ... |
correct output |
---|
777777777777777777 777777777777777777 555555555555555555 111111111111111111 555555555555555555 ... |
user output |
---|
888888888888888888 888888888888888888 555555555555555555 222222222222222222 55555555555555 ... Truncated |