結果

問題 No.146 試験監督(1)
ユーザー 西尾西尾
提出日時 2018-03-13 16:52:18
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 134 ms / 1,000 ms
コード長 381 bytes
コンパイル時間 1,657 ms
コンパイル使用メモリ 165,640 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-01 23:37:50
合計ジャッジ時間 2,914 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

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

int main()
{
int i;
int N;
long long C;
long long D;
long long iSum;
int iMod = 1000000007;

	cin >> N;

	iSum = 0;
	for( i = 0; i < N; i++ )
	{
		cin >> C;
		cin >> D;
		if( C % 2 == 0 )
			C /= 2;
		else
		{
			C /= 2;
			C++;
		}

		C %= iMod;
		D %= iMod;
		iSum += C * D;
		iSum %= iMod;
	}

	cout << iSum << endl;

	return 0;
}
0