結果
| 問題 |
No.146 試験監督(1)
|
| コンテスト | |
| ユーザー |
Nasatame
|
| 提出日時 | 2017-03-29 09:04:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 737 bytes |
| コンパイル時間 | 564 ms |
| コンパイル使用メモリ | 56,564 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-06 14:46:45 |
| 合計ジャッジ時間 | 1,697 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 3 |
ソースコード
#include <iostream>
using namespace std;
using ll = unsigned long long int;
ll Multiplation(ll a,ll b){
if(b == 0){
return 0;
}
ll tmp = 2*Multiplation(a,b>>1);
tmp %= 1000000007;
if(b%2 == 1){
tmp += a;
tmp %= 1000000007;
return tmp;
}else{
return tmp;
}
}
//1000000007
//1000000007
int main(void){
// Here your code !
int n;
cin >> n;
ll res = 0;
for(int i = 0; i < n; i++){
ll c,d;
cin >> c >> d;
c %= 1000000007;
d %= 1000000007;
c = (c+1)/2;
res += Multiplation(c,d);
res %= 1000000007;
}
cout << res << endl;
return 0;
}
Nasatame