結果
問題 | No.146 試験監督(1) |
ユーザー |
|
提出日時 | 2018-06-13 18:38:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 589 ms |
コンパイル使用メモリ | 66,204 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 14:08:48 |
合計ジャッジ時間 | 1,664 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 3 |
ソースコード
#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; }