Code Submission Evaluation System Login

HIIT Open 2016

Start:2016-05-28 11:00:00
End:2016-05-28 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2016 - Results
History
2016-05-28 16:44:55
2016-05-28 16:43:21
2016-05-28 16:39:47
2016-05-28 15:07:52
2016-05-28 14:46:10
2016-05-28 14:43:32
2016-05-28 14:29:42
2016-05-28 14:01:36
2016-05-28 13:44:58
Task:Cent saving
Sender:ContinuedLife
Submission time:2016-05-28 15:07:52
Language:C++
Status:READY
Result:WRONG ANSWER

Test results

testverdicttime (s)
#1WRONG ANSWER0.06 / 1.00details
#2WRONG ANSWER0.05 / 1.00details

Code

#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout.precision(6);

using namespace std;

bool mycomp(int a, int b){
	return a > b;
}

int main(){ _
	int TC;	cin >> TC;
	while(TC--){
		int n,sum = 0, num;	cin >> n;

		int n1 = 0, n2 = 0, save = 0;
		for(int i = 0; i < n; ++i){
			cin >> num;
			sum += num;
			num %= 5;
			switch(num){
				case 0:	num = 0;	break;
				case 1:	num = -1;	break;
				case 2:	num = -2;	break;
				case 3:	num = 2;	break;
				case 4:	num = 1;	break;
			}
			if(num == 1)	n1 += 1;
			if(num == 2)	n2 += 1;
			if(num <= 0)	save += num;
		}

		int minN = min(n1, n2);
		save += -2 * minN;
		n1 -= minN;	n2 -= minN;

		if(n1 != 0){
			int beishu = n1 / 3;
			save += -2*beishu + n1%3;
		} else {
			int beishu = n2/ 2;
			save += -1 * beishu + n2%2*2;
		}

		cout << sum + save << endl;
	}
	return 0;
}

Test details

Test 1

Verdict: WRONG ANSWER

input
100
1000
528433894 255789530 559301042 ...
view   save

correct output
475191144965
460688647850
478543444030
475238936090
456736521510
477687545180
464978309415
469754811210
473772861015
459378192990
484964363025
469227939745
476076446280
463968012420
480317542525
458834989560
472694971870
467845191980
475238640235
470940911790
...
view   save

user output
-1550224891
1127147178
1802074174
-1502433766
1469988134
946175324
1121841447
1603375946
1326458455
-183307682
-366941423
1076504481
-664923576
111544452
-718794627
-726511112
248569310
-306243284
-1502729621
-1505490770
...
view   save

Test 2

Verdict: WRONG ANSWER

input
1
100000
666086355 190481330 514353517 ...
view   save

correct output
47176864928795
view   save

user output
944149531
view   save