結果

問題 No.814 ジジ抜き
ユーザー sinsincoscos
提出日時 2019-04-13 15:04:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 827 ms
コンパイル使用メモリ 64,256 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2024-09-15 11:06:56
合計ジャッジ時間 9,954 ms
ジャッジサーバーID
(参考情報)
judge6 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 2
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:34: warning: built-in function 'pow' declared as non-function [-Wbuiltin-declaration-mismatch]
    6 | ll K[300010],L[300010],D[300010],pow[60] = {1};
      |                                  ^~~

ソースコード

diff #

#include <iostream>
using namespace std;
typedef long long ll;

int N;
ll K[300010],L[300010],D[300010],pow[60] = {1};

int main(){
    cin >> N;
    for(int i=1;i<=N;i++){
        cin >> K[i] >> L[i] >> D[i];
    }
    for(int i=1;i<60;i++) pow[i] = 2*pow[i-1];
    ll l = -1,r = 1e18;
    while(l+1<r){
        ll m = (l+r)/2;
        ll cnt = 0;
        for(int i=1;i<=N;i++){
            if(m>=L[i]) cnt += min((m-L[i])/pow[D[i]]+1,K[i]);
        }
        if(cnt%2==1) r = m;
        else l = m;
    }
    cout << r << endl;
}
0