結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,420 KB
testcase_01 AC 2 ms
7,468 KB
testcase_02 AC 2 ms
7,424 KB
testcase_03 AC 6 ms
7,732 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 483 ms
10,312 KB
testcase_07 AC 190 ms
8,760 KB
testcase_08 AC 338 ms
10,560 KB
testcase_09 AC 352 ms
9,580 KB
testcase_10 AC 468 ms
10,232 KB
testcase_11 AC 475 ms
10,316 KB
testcase_12 AC 224 ms
8,804 KB
testcase_13 AC 225 ms
8,652 KB
testcase_14 AC 339 ms
9,608 KB
testcase_15 AC 178 ms
8,376 KB
testcase_16 AC 145 ms
8,608 KB
testcase_17 AC 385 ms
9,784 KB
testcase_18 AC 315 ms
9,340 KB
testcase_19 AC 383 ms
10,448 KB
testcase_20 AC 240 ms
8,620 KB
testcase_21 AC 223 ms
8,880 KB
testcase_22 AC 287 ms
9,816 KB
testcase_23 AC 172 ms
8,388 KB
testcase_24 AC 274 ms
9,352 KB
testcase_25 AC 210 ms
8,760 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 = 2e18;
    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