結果

問題 No.146 試験監督(1)
ユーザー NasatameNasatame
提出日時 2017-03-29 08:51:41
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 684 bytes
コンパイル時間 366 ms
コンパイル使用メモリ 51,180 KB
実行使用メモリ 4,568 KB
最終ジャッジ日時 2023-09-20 19:49:32
合計ジャッジ時間 1,460 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    }
}


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 += c*d;
        
        res %= 1000000007;
    }
    
    cout << res << endl;
    
}
0