結果

問題 No.146 試験監督(1)
ユーザー kongarishisyamokongarishisyamo
提出日時 2016-03-05 01:53:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 275 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 59,584 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 19:50:40
合計ジャッジ時間 1,566 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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