結果
| 問題 | No.146 試験監督(1) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-03 19:12:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 312 bytes |
| 記録 | |
| コンパイル時間 | 738 ms |
| コンパイル使用メモリ | 52,892 KB |
| 最終ジャッジ日時 | 2025-12-16 00:42:52 |
| 合計ジャッジ時間 | 1,878 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.cpp: In function ‘int main(int, const char**)’:
main.cpp:7:9: error: ‘uint64_t’ was not declared in this scope
7 | uint64_t N, c, d;
| ^~~~~~~~
main.cpp:2:1: note: ‘uint64_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
1 | #include <iostream>
+++ |+#include <cstdint>
2 |
main.cpp:8:16: error: ‘N’ was not declared in this scope
8 | cin >> N;
| ^
main.cpp:9:17: error: expected ‘;’ before ‘sum’
9 | uint64_t sum = 0;
| ^~~~
| ;
main.cpp:10:17: error: expected ‘;’ before ‘mod’
10 | uint64_t mod = (uint64_t)(1e9 + 7);
| ^~~~
| ;
main.cpp:12:24: error: ‘c’ was not declared in this scope
12 | cin >> c >> d;
| ^
main.cpp:12:29: error: ‘d’ was not declared in this scope
12 | cin >> c >> d;
| ^
main.cpp:13:17: error: ‘sum’ was not declared in this scope
13 | sum += ((c + 1) / 2 % mod) * (d % mod);
| ^~~
main.cpp:13:39: error: ‘mod’ was not declared in this scope
13 | sum += ((c + 1) / 2 % mod) * (d % mod);
| ^~~
main.cpp:16:17: error: ‘sum’ was not declared in this scope
16 | cout << sum << endl;
| ^~~
ソースコード
#include <iostream>
using namespace std;
int main(int argc, const char* argv[])
{
uint64_t N, c, d;
cin >> N;
uint64_t sum = 0;
uint64_t mod = (uint64_t)(1e9 + 7);
for (int i = 0; i < N; i++) {
cin >> c >> d;
sum += ((c + 1) / 2 % mod) * (d % mod);
sum %= mod;
}
cout << sum << endl;
return 0;
}