結果

問題 No.814 ジジ抜き
ユーザー sinsincoscossinsincoscos
提出日時 2019-04-13 15:04:12
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 1,785 ms
コンパイル使用メモリ 64,288 KB
実行使用メモリ 10,476 KB
最終ジャッジ日時 2023-10-13 14:19:55
合計ジャッジ時間 9,717 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,416 KB
testcase_01 AC 2 ms
7,400 KB
testcase_02 AC 2 ms
7,680 KB
testcase_03 AC 7 ms
7,512 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 478 ms
10,304 KB
testcase_07 AC 189 ms
8,516 KB
testcase_08 AC 335 ms
10,364 KB
testcase_09 AC 345 ms
9,456 KB
testcase_10 AC 462 ms
10,208 KB
testcase_11 AC 468 ms
10,184 KB
testcase_12 AC 222 ms
8,560 KB
testcase_13 AC 218 ms
8,760 KB
testcase_14 AC 334 ms
9,528 KB
testcase_15 AC 177 ms
8,312 KB
testcase_16 AC 145 ms
8,436 KB
testcase_17 AC 381 ms
9,772 KB
testcase_18 AC 312 ms
9,168 KB
testcase_19 AC 380 ms
10,396 KB
testcase_20 AC 235 ms
8,548 KB
testcase_21 AC 220 ms
8,720 KB
testcase_22 AC 283 ms
9,652 KB
testcase_23 AC 167 ms
8,396 KB
testcase_24 AC 268 ms
9,372 KB
testcase_25 AC 206 ms
8,744 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:34: 警告: 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