結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
srup٩(๑`н´๑)۶
|
| 提出日時 | 2016-10-08 07:46:24 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 393 bytes |
| コンパイル時間 | 494 ms |
| コンパイル使用メモリ | 56,708 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-21 20:24:41 |
| 合計ジャッジ時間 | 1,427 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:19:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=]
19 | printf("%d\n", ans % mod);
| ~^ ~~~~~~~~~
| | |
| int ll {aka long long int}
| %lld
ソースコード
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
const int mod = 1e9 + 7;
int main(void){
ll n; cin >> n;
ll ans = 0;
rep(i, n){
ll c, d; cin >> c >> d;
if(c % 2 == 0){
(ans += (c / 2) * d) %= mod;
}else{
(ans += (c / 2 + 1) * d) %= mod;
}
}
printf("%d\n", ans % mod);
return 0;
}
srup٩(๑`н´๑)۶