結果

問題 No.146 試験監督(1)
ユーザー ふうふう
提出日時 2015-02-22 15:47:29
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 743 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 84,008 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-06 02:57:43
合計ジャッジ時間 1,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
4,376 KB
testcase_01 AC 126 ms
4,380 KB
testcase_02 AC 125 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <map>
#include <set>
#include <list>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <iomanip>
#include <functional>

#define SIZE 1005
#define INF 100000000
#define ll long long
#define FD(d) fixed << setprecision(d)
#define MOD 1000000007
     
using namespace std;
 
#define ll long long
 
typedef pair<int, int> Pa;

int main()
{
	ll n;

	cin >> n;

	ll res = 0;
	for (ll i = 0; i < n; i++) {
		ll c, d;
		cin >> c >> d;

		res += ((c + 1) / 2) % MOD * (d % MOD);
		res %= MOD;
	}
	cout << res << endl;

	return (0);
}
/*
3 7
3 4
4 5
2 3


*/
0