Task: | Alien Invasion II |
Sender: | bigint bugaa |
Submission time: | 2019-05-25 11:04:48 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.02 s | details |
#2 | WRONG ANSWER | 0.02 s | details |
#3 | WRONG ANSWER | 0.04 s | details |
Code
#include <iostream> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(0); ll n; cin >> n; int sum = 0; ll tmp = n; ll mult = 1; while(tmp > 0) { sum += (tmp % 10) % 3; tmp /= 10; mult *= 10; } sum %= 3; if (sum == 0) n += mult * 3; else if (sum == 1) n += mult * 2; else n += mult; cout << n << '\n'; cout << n/3 << ' ' << 3 << '\n'; }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
2368469234876449 |
correct output |
---|
22368469234876449 3 7456156411625483 |
user output |
---|
22368469234876449 7456156411625483 3 |
Test 2
Verdict: WRONG ANSWER
input |
---|
292929292929292929292929292931 |
correct output |
---|
129292929292929292929292929293... |
user output |
---|
-7670116110564327425 -2556705370188109141 3 |
Test 3
Verdict: WRONG ANSWER
input |
---|
292929292929292929292929292979 |
correct output |
---|
129292929292929292929292929297... |
user output |
---|
-7670116110564327425 -2556705370188109141 3 |