結果
問題 | No.146 試験監督(1) |
ユーザー | ohreitetsu |
提出日時 | 2018-06-13 18:38:14 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 883 ms |
コンパイル使用メモリ | 65,368 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-13 03:55:23 |
合計ジャッジ時間 | 1,927 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
ソースコード
#include <iostream> using namespace std; typedef long long LL; const LL MAX=1e9+7; int main(int argc, char* argv[]) { int N; cin>>N; LL ans=0; int i; LL C; LL D; for (i=0;i<N;i++){ cin>>C; cin>>D; if (C==1){ ans+=D; }else{ if (C%2==0){ ans+=(C/2)*D; }else{ ans+=(C/2+1)*D; } } ans%=MAX; } cout<<ans<<endl; return 0; }