Task: | Alien Invasion II |
Sender: | nv2000 |
Submission time: | 2020-09-19 13:22:15 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
Code
#include <iostream> #include <vector> #include <cmath> using namespace std; vector<int> solve(int n) { int sum = 0; int i = 0; while(n>0) { int m = n % 10; sum += m; n /= 10; i++; } return {sum, i}; } int main() { int n; cin >> n; vector<int> g = solve(n); //cout << g[0] << " " << g[1] << endl; int r = 3 - (g[0] % 3); int q = r * pow(10, g[1]) + n + 1; cout << q << endl << 3 << " " << q / 3; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
2368469234876449 |
correct output |
---|
22368469234876449 3 7456156411625483 |
user output |
---|
-2147483648 3 -715827882 |
Test 2
Verdict: WRONG ANSWER
input |
---|
292929292929292929292929292931 |
correct output |
---|
129292929292929292929292929293... |
user output |
---|
-2147483648 3 -715827882 |
Test 3
Verdict: WRONG ANSWER
input |
---|
292929292929292929292929292979 |
correct output |
---|
129292929292929292929292929297... |
user output |
---|
-2147483648 3 -715827882 |