結果
問題 |
No.146 試験監督(1)
|
ユーザー |
![]() |
提出日時 | 2017-03-29 08:54:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 556 ms |
コンパイル使用メモリ | 55,428 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-06 14:45:12 |
合計ジャッジ時間 | 1,603 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 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; }