Task: | Lista |
Sender: | Anttono |
Submission time: | 2022-01-22 15:24:15 +0200 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.04 s | 2, 3 | details |
#3 | TIME LIMIT EXCEEDED | -- | 3 | details |
#4 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#5 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#6 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#7 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
#8 | WRONG ANSWER | 0.83 s | 3 | details |
#9 | TIME LIMIT EXCEEDED | -- | 3 | details |
#10 | TIME LIMIT EXCEEDED | -- | 3 | details |
Compiler report
input/code.cpp: In function 'bool eq(std::__cxx11::string, int)': input/code.cpp:13:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for(int i=0;i<s.size();i++) ~^~~~~~~~~ input/code.cpp: In function 'int main()': input/code.cpp:41:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(s.size()>dig(nxt)) nxt++; ~~~~~~~~^~~~~~~~~ input/code.cpp:42:38: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] while(!eq(s, nxt) && s.size()==dig(nxt)) nxt++; ~~~~~~~~^~~~~~~~~~ input/code.cpp:43:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if(s.size()<dig(nxt)) ~~~~~~~~^~~~~~~~~
Code
#include <bits/stdc++.h> using namespace std; int n; bool pos = true; vector<int> r; bool eq(string s, int x) { bool res = true; reverse(s.begin(), s.end()); for(int i=0;i<s.size();i++) { if(s[i] != '?' && s[i]-'0' != x%10) res = false; x /= 10; } return res; } int dig(int x) { int res = 0; while(x>0) { res++; x /= 10; } return res; } int main() { cout<<eq("105", 150)<<'\n'; cin>>n; string s; int nxt = 1; for(int i=0;i<n;i++) { cin>>s; while(s.size()>dig(nxt)) nxt++; while(!eq(s, nxt) && s.size()==dig(nxt)) nxt++; if(s.size()<dig(nxt)) { pos = false; break; } r.push_back(nxt); nxt++; } if(pos) for(int i=0;i<n;i++) { cout<<r[i]<<'\n'; } else cout<<"IMPOSSIBLE"; }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
100 ?? ?? ?? ?? ... |
correct output |
---|
10 11 12 13 20 ... |
user output |
---|
0 10 11 12 13 ... Truncated |
Test 2
Group: 2, 3
Verdict: WRONG ANSWER
input |
---|
1000 8?? ??8? ???? ???? ... |
correct output |
---|
800 1080 1081 1082 1083 ... |
user output |
---|
0 800 1080 1081 1082 ... Truncated |
Test 3
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000 ?????? ?????9? ??98??? ?????5? ... |
correct output |
---|
100000 1000090 1098000 1098050 4100001 ... |
user output |
---|
(empty) |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
100 ? ? ? ? ... |
correct output |
---|
1 2 3 4 5 ... |
user output |
---|
0 1 2 3 4 ... Truncated |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
2 ??? ?? |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 IMPOSSIBLE |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
3 123 ??? 124 |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 IMPOSSIBLE |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
input |
---|
5 1?? ??? 2?? ??? ... |
correct output |
---|
IMPOSSIBLE |
user output |
---|
0 IMPOSSIBLE |
Test 8
Group: 3
Verdict: WRONG ANSWER
input |
---|
1000 ????????? ????????? ????????? ????????? ... |
correct output |
---|
100000000 100000001 100000002 100000003 100000004 ... |
user output |
---|
0 100000000 100000001 100000002 100000003 ... Truncated |
Test 9
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
900 ???000000 ???000000 ???000000 ???000000 ... |
correct output |
---|
100000000 101000000 102000000 103000000 104000000 ... |
user output |
---|
(empty) |
Test 10
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000 ???1????? ???0????? ???1????? ???0????? ... |
correct output |
---|
100100000 101000000 101100000 102000000 102100000 ... |
user output |
---|
(empty) |