Submission #8585221


Source Code Expand

Copy
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);

  int m;
  cin >> m;
  vector<int> d(m);
  vector<long long> c(m);
  long long ans = 0, s = 0;
  for (int i = 0; i < m; ++i) {
    cin >> d[i] >> c[i];
    ans += c[i];
    s += c[i] * d[i];
  }
  cout << ans -  1 + (s - 1) / 9;

  return 0;
}

Submission Info

Submission Time
Task D - Digit Sum Replace
User achvanov
Language C++14 (GCC 5.4.1)
Score 500
Code Size 382 Byte
Status AC
Exec Time 34 ms
Memory 2560 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 2
AC × 20
Set Name Test Cases
Sample 00-sample-01.txt, 00-sample-02.txt
All 00-sample-01.txt, 00-sample-02.txt, 01-corner-01.txt, 01-corner-02.txt, 01-corner-03.txt, 02-random-01.txt, 02-random-02.txt, 02-random-03.txt, 02-random-04.txt, 02-random-05.txt, 02-random-06.txt, 02-random-07.txt, 02-random-08.txt, 02-random-09.txt, 02-random-10.txt, 02-random-11.txt, 03-max-01.txt, 03-max-02.txt, 04-min-01.txt, 04-min-02.txt
Case Name Status Exec Time Memory
00-sample-01.txt AC 1 ms 256 KB
00-sample-02.txt AC 1 ms 256 KB
01-corner-01.txt AC 1 ms 256 KB
01-corner-02.txt AC 1 ms 256 KB
01-corner-03.txt AC 1 ms 256 KB
02-random-01.txt AC 1 ms 256 KB
02-random-02.txt AC 1 ms 256 KB
02-random-03.txt AC 1 ms 256 KB
02-random-04.txt AC 1 ms 256 KB
02-random-05.txt AC 1 ms 256 KB
02-random-06.txt AC 33 ms 2560 KB
02-random-07.txt AC 34 ms 2560 KB
02-random-08.txt AC 33 ms 2560 KB
02-random-09.txt AC 32 ms 2560 KB
02-random-10.txt AC 34 ms 2560 KB
02-random-11.txt AC 33 ms 2560 KB
03-max-01.txt AC 26 ms 1920 KB
03-max-02.txt AC 1 ms 256 KB
04-min-01.txt AC 26 ms 2048 KB
04-min-02.txt AC 1 ms 256 KB