Task: | Cent saving |
Sender: | \(._.)/ |
Submission time: | 2024-09-28 14:12:13 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.05 s | details |
#2 | WRONG ANSWER | 0.05 s | details |
Code
// Online C++ compiler to run C++ program online #include <iostream> #include <iomanip> #include <vector> #include <cmath> using namespace std; int main() { int t; cin >> t; for (int test = 0; test < t; test++) { int n; cin >> n; int sum = 0; int a1 = 0; int a2 = 0; for (int i = 0; i < n; i++) { int x; cin >> x; sum += (x/5)*5; x = x % 5; if (x == 3) a2 += 1; if (x == 4) a1 += 1; } int a = min(a1, a2); sum += a * 5; a1 -= a; a2 -= a; sum += (a2 / 2) * 5; a2 = a2 % 2; sum += (a1 / 3) * 10; a1 = a1 % 3; if (a2 == 0 or a1 == 0) sum += (a1 + a2) * 5; else sum += ( (a1 * 3 + a2 * 4) / 5 ) * 5; cout << sum << endl; } return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
100 1000 528433894 255789530 559301042 ... |
correct output |
---|
475191144965 460688647850 478543444030 475238936090 456736521510 ... |
user output |
---|
-1550224891 1127147178 1802074174 -1502433766 1469988134 ... Truncated |
Test 2
Verdict: WRONG ANSWER
input |
---|
1 100000 666086355 190481330 514353517 ... |
correct output |
---|
47176864928795 |
user output |
---|
944149531 |