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 12:38:26
2016-05-28 12:32:22
2016-05-28 12:29:13
Task:Cent saving
Sender:Noname 01
Submission time:2016-05-28 12:29:13
Language:C++
Status:READY
Result:WRONG ANSWER

Test results

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

Code

// NONAME-01

#include <bits/stdc++.h>


using namespace std;


vector<int> a;
long long c[5];
long long total;
int n;

void Load()
{
  cin >> n;
  a.resize(n);
  total = 0;
  memset(c, 0, sizeof(c));
  for (int i = 0; i < n; i++) {
	  cin >> a[i];
	  total += a[i];
	  c[a[i] % 5]++;
  }
}

void Solve()
{
  long long sav = 0;
  // c0 ignore;
  // c1 -> save 1;
  // c2 -> save 2;
  sav += c[1];
  sav += 2*c[2];
  sav -= 2*c[3];
  sav -= c[4];
  // group c[4] and c[3] for +5;
  long long i = c[4];
  if (i < c[3]) i = c[3];
  sav += 5*i;
  c[4] -= i;
  c[3] -= i;
  // group c3 together;
  i = c[3] / 2;
  sav += 5*i;
  cout << total - sav << "\n";
}

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int nt, tt;
  cin >> nt;
  for (tt = 0; tt < nt; tt++) {
  Load();
  Solve();
  }
  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
475191144945
460688647835
478543444010
475238936040
456736521500
477687545155
464978309415
469754811150
473772860995
459378192965
484964363015
469227939675
476076446275
463968012305
480317542520
458834989435
472694971855
467845191970
475238640220
470940911790
...
view   save

Test 2

Verdict: WRONG ANSWER

input
1
100000
666086355 190481330 514353517 ...
view   save

correct output
47176864928795
view   save

user output
47176864928575
view   save