結果

問題 No.146 試験監督(1)
ユーザー 👑 obakyanobakyan
提出日時 2019-03-31 00:25:24
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 136 ms / 1,000 ms
コード長 460 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 72,252 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-28 18:44:03
合計ジャッジ時間 1,715 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <iostream>
#include <iomanip>

#define ASDF (1000000007)

int main(void)
{
	long n;
	long c, d;
	long tot = 0;
	std::cin >> n;
	for (long i = 0; i < n; i++) {
		std::cin >> c >> d;
        c = (c + 1) / 2;
        c %= ASDF;
        d %= ASDF;
		tot = (tot + c * d) % ASDF;
	}
	std::cout << tot << std::endl;
	return 0;
}
0