結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-22 22:44:13 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 36 ms / 1,000 ms |
| コード長 | 513 bytes |
| コンパイル時間 | 179 ms |
| コンパイル使用メモリ | 30,592 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-21 13:56:11 |
| 合計ジャッジ時間 | 828 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:12:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%u", &N);
| ~~~~~^~~~~~~~~~
main.cpp:21:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
21 | scanf("%llu %llu", &lC, &lD);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(int argc, char *argv[])
{
int N = 0;
scanf("%u", &N);
unsigned long long lC = 0;
unsigned long long lD = 0;
unsigned long long lE = 0;
unsigned long long mod = 1000000000 + 7;
for (int i = 0; i < N; i++)
{
scanf("%llu %llu", &lC, &lD);
if (lC % 2 == 0)
lE += ( lC / 2 ) % mod * ( lD % mod ) % mod;
else
lE += ( lC / 2 + 1 ) % mod * ( lD % mod ) %mod;
}
printf("%llu\n", lE % mod);
return 0;
}