結果

問題 No.146 試験監督(1)
ユーザー kyuridenamidakyuridenamida
提出日時 2015-02-08 23:43:53
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 129 ms / 1,000 ms
コード長 325 bytes
コンパイル時間 1,984 ms
コンパイル使用メモリ 143,696 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 12:16:09
合計ジャッジ時間 2,194 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

unsigned long long mod = 1e9+7;

int main(){
	int N;
	cin >> N;
	long long ans = 0;
	for(int i = 0 ; i < N ; i++){
		long long C,D;
		cin >> C >> D;
		C++;
		long long A = C/2;
		long long B = D;
		A %= mod;
		B %= mod;
		ans += A*B;
		ans %= mod;
	}
	cout << ans%mod << endl;
}
0