Task: | Suuremmat |
Sender: | Eljas |
Submission time: | 2021-01-23 16:43:03 +0200 |
Language: | C++ (C++17) |
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:19:8: warning: unused variable 'changed' [-Wunused-variable] bool changed; ^~~~~~~
Code
#include <iostream> #include <vector> #include <string> int main() { int n = 0; std::cin >> n; std::vector<int> vec(n); for (int i = 0; i < n; i++) { std::cin >> vec[i]; } std::string s; char largest; bool changed; int length; for (int i = 0; i < n; i++) { s = std::to_string(vec[i]); length = s.size(); largest = s[0] - '0'; int j = 1; while (s[j]-'0' > largest + 1 || j > length) { largest = s[i] - '0'; j++; } if (largest <= 10) { std::string s2 = std::to_string(largest + 1); for (int j = 0; j < length; j++) { std::cout << s2; } } else { for (int j = 0; j < length + 1; j++) { std::cout << '1'; } } std::cout << '\n'; } }
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 |
---|
3333333333 1 1 1 1 ... Truncated |