結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
xuelei
|
| 提出日時 | 2018-07-29 01:02:45 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 254 bytes |
| コンパイル時間 | 1,282 ms |
| コンパイル使用メモリ | 159,232 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-06 15:51:41 |
| 合計ジャッジ時間 | 2,399 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:20: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
13 | ans+=(c+1)/2%N*d%N;
| ~~~^~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=unsigned long long;
const ll N=pow(10,9)+7;
int main(){
int n;
cin >> n;
ll c,d,ans;
for(int i=0;i<n;i++){
cin >> c >> d;
ans+=(c+1)/2%N*d%N;
ans%=N;
}
cout << ans << endl;
return 0;
}
xuelei