結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
くれちー
|
| 提出日時 | 2016-08-24 22:58:27 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 02:11:18 |
| 合計ジャッジ時間 | 941 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%d", &n);
| ^~~~~~~~~~~~~~~
main.c:10:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%lld %lld", &c, &d);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main() {
long long int c, d, e, sum = 0;
int n, i;
int const mod = 1000000007;
scanf("%d", &n);
for (i = 0; i < n; i++) {
scanf("%lld %lld", &c, &d);
e = (i % 2 == 0) ? (c / 2) : (c / 2 + 1);
sum += (e % mod) * (d % mod);
sum %= mod;
}
printf("%lld\n", sum);
return 0;
}
くれちー