Submission #8580335


Source Code Expand

Copy
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <cmath>

auto& in = std::cin;
auto& out = std::cout;
#define all_range(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;


int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	int64_t N = 0;
	int64_t len = 0;
	int64_t res = 0;
	int M;
	in >> M;
	for (size_t i = 0; i < M; i++)
	{
		int64_t d, num;
		in >> d>> num;

		N += d* num;
		len += num;
	}


	res = (len - 1);
	while (N>=10) {
		res += N / 10;
		N = (N % 10) + N / 10;
	}
	out << res << endl;



	return 0;
}
#endif

Submission Info

Submission Time
Task D - Digit Sum Replace
User eiya
Language C++14 (GCC 5.4.1)
Score 500
Code Size 1088 Byte
Status AC
Exec Time 32 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 32 ms 256 KB
02-random-07.txt AC 32 ms 256 KB
02-random-08.txt AC 32 ms 256 KB
02-random-09.txt AC 31 ms 256 KB
02-random-10.txt AC 32 ms 256 KB
02-random-11.txt AC 32 ms 256 KB
03-max-01.txt AC 24 ms 256 KB
03-max-02.txt AC 1 ms 256 KB
04-min-01.txt AC 25 ms 256 KB
04-min-02.txt AC 1 ms 256 KB