結果

問題 No.146 試験監督(1)
ユーザー BwambocosBwambocos
提出日時 2017-03-28 14:05:39
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 730 bytes
コンパイル時間 714 ms
コンパイル使用メモリ 91,660 KB
実行使用メモリ 5,176 KB
最終ジャッジ日時 2023-09-20 18:27:24
合計ジャッジ時間 1,876 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <map>
#include <set>
#include <array>
#include <queue>
#include <string>
#include <vector>
#include <numeric>
#include <algorithm>
#include <functional>
#define MOD 1000000007
#define INF 11234567890
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
typedef std::pair<int, int> P;

LL N, C[112345], D[112345];
LL ans;

int main()
{
	in >> N;
	rep(i, N) { in >> C[i] >> D[i]; }

	rep(i, N)
	{
		if (C[i] % 2 == 1)
		{
			ans += (C[i] / 2 + 1) * D[i];
		}
		else
		{
			ans += (C[i] / 2) * D[i];
		}
		ans %= MOD;
	}

	out << ans << std::endl;
	return 0;
}
0