結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-10-22 17:51:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 30,336 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 13:49:29 |
| 合計ジャッジ時間 | 886 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 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:20:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
20 | 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;
for (int i = 0; i < N; i++)
{
scanf("%llu %llu", &lC, &lD);
if (lC == 1 || lC == 2)
lE += lD;
else
{
if (lC % 2 == 0)
lE += ( lC / 2 ) * lD;
else
lE += ( lC / 2 + 1 ) * lD;
}
}
if( lE > 1000000000 )
printf("%llu\n", lE % 1000000000 + 7);
else
printf("%llu\n", lE);
return 0;
}