結果

問題 No.146 試験監督(1)
ユーザー dnishdnish
提出日時 2017-07-04 00:03:41
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 141 ms / 1,000 ms
コード長 319 bytes
コンパイル時間 1,598 ms
コンパイル使用メモリ 163,416 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 14:51:24
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int) N;i++)
#define p(s) cout<<(s)<<endl
typedef long long ll;
using namespace std;
const ll mod=1e9+7;

int main(){
	int N;
	cin>>N;
	ll ans=0;
	REP(i,0,N){
		ll a,b;
		cin>>a>>b;
		a=((a+1)/2)%mod;
		b%=mod;
		ans+=a*b;
		ans%=mod;
	}
	p(ans);
	return 0;
}
0