Submission #8579933


Source Code Expand

Copy
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int main(void){
	int m,i;
	ll d,c,ans=-1ll,tmp=-1ll;
	cin >> m;
	for(i=0; i<m; ++i){
		cin >> d >> c;
		ans += c;
		tmp += d*c;
	}
	tmp /= 9ll;
	ans += tmp;
	cout << ans << endl;
	return 0;
}

Submission Info

Submission Time
Task D - Digit Sum Replace
User ransewhale
Language C++14 (GCC 5.4.1)
Score 500
Code Size 560 Byte
Status AC
Exec Time 115 ms
Memory 256 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 110 ms 256 KB
02-random-07.txt AC 112 ms 256 KB
02-random-08.txt AC 114 ms 256 KB
02-random-09.txt AC 110 ms 256 KB
02-random-10.txt AC 115 ms 256 KB
02-random-11.txt AC 115 ms 256 KB
03-max-01.txt AC 84 ms 256 KB
03-max-02.txt AC 1 ms 256 KB
04-min-01.txt AC 84 ms 256 KB
04-min-02.txt AC 1 ms 256 KB