結果

問題 No.146 試験監督(1)
ユーザー kongarishisyamo
提出日時 2016-03-05 01:53:40
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 275 bytes
コンパイル時間 576 ms
コンパイル使用メモリ 59,248 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-24 14:13:13
合計ジャッジ時間 2,003 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>

using namespace std;

#define MOD ((int)pow(10.0,9)+7)

int main(){

	long long N,C,D,ans=0;

	cin>>N;
	for(int i=0;i<N;i++){
		cin>>C>>D;
		long long tmp=(C-1)/2+1;
		tmp%=MOD;
		D%=MOD;
		ans+=(tmp*D);
		ans%=MOD;
	}
	cout<<ans<<endl;
}
0