Task: | Cent saving |
Sender: | zah |
Submission time: | 2016-05-28 13:07:18 +0300 |
Language: | C++ |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.06 s | details |
#2 | WRONG ANSWER | 0.06 s | details |
Code
#include <iostream> using namespace std; //ios_base::sync_with_stdio(0); //cin.tie(0); int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int t; cin >> t; int n; long long x; int modulo; int kol; int nel; long long summa; int tmp; /*int alkuluvut[1001] = {}; alkuluvut[1] = 1; for(int i=2; i<100; i++) { for(int j=i*i; j<1001; j+=i) alkuluvut[j]=1; } */ for(int i=0; i<t; i++) { cin >> n; summa = 0; kol = 0; nel = 0; for(int j=0; j<n; j++) { cin >> x; summa += x; modulo = x%5; if(modulo<3) { summa -= modulo; continue; } else { if(modulo==4) { nel += 1; } else kol += 1; } } tmp = min(kol,nel); summa -= 2*tmp; kol -= tmp; nel -= tmp; if(kol==0) { summa -= 2*nel/3; summa += nel%3 ; } else { summa -= kol/2; summa += kol%2*2; } cout << summa << "\n"; } }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
100 1000 528433894 255789530 559301042 ... |
correct output |
---|
475191144965 460688647850 478543444030 475238936090 456736521510 ... |
user output |
---|
475191144965 460688647850 478543444029 475238936090 456736521510 ... Truncated |
Test 2
Verdict: WRONG ANSWER
input |
---|
1 100000 666086355 190481330 514353517 ... |
correct output |
---|
47176864928795 |
user output |
---|
47176864928794 |