結果

問題 No.814 ジジ抜き
ユーザー 沙耶花沙耶花
提出日時 2020-12-08 16:59:00
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 309 ms / 3,000 ms
コード長 576 bytes
コンパイル時間 2,297 ms
コンパイル使用メモリ 203,988 KB
実行使用メモリ 10,476 KB
最終ジャッジ日時 2023-10-17 17:21:05
合計ジャッジ時間 9,077 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 4 ms
4,348 KB
testcase_04 AC 307 ms
10,476 KB
testcase_05 AC 309 ms
10,476 KB
testcase_06 AC 302 ms
10,212 KB
testcase_07 AC 93 ms
6,780 KB
testcase_08 AC 149 ms
10,212 KB
testcase_09 AC 218 ms
8,364 KB
testcase_10 AC 279 ms
9,948 KB
testcase_11 AC 299 ms
10,212 KB
testcase_12 AC 132 ms
6,780 KB
testcase_13 AC 130 ms
6,780 KB
testcase_14 AC 193 ms
8,628 KB
testcase_15 AC 105 ms
5,988 KB
testcase_16 AC 72 ms
5,988 KB
testcase_17 AC 243 ms
8,892 KB
testcase_18 AC 183 ms
8,100 KB
testcase_19 AC 199 ms
10,212 KB
testcase_20 AC 147 ms
6,780 KB
testcase_21 AC 114 ms
7,308 KB
testcase_22 AC 131 ms
9,216 KB
testcase_23 AC 93 ms
6,252 KB
testcase_24 AC 137 ms
8,364 KB
testcase_25 AC 97 ms
7,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000000

int main(){
	
	int N;
	cin>>N;
	
	vector<long long> K(N),L(N),D(N);
	rep(i,N){
		scanf("%lld %lld %lld",&K[i],&L[i],&D[i]);
	}
	
	long long ok = 1000000000000000000,ng = -1;
	
	while(ok-ng>1){
		long long mid = (ok+ng)/2;
		
		int sum = 0;
		
		rep(i,N){
			if(mid<L[i])continue;
			long long temp = mid-L[i];
			long long x = min(K[i],temp / (1LL<<D[i]) + 1);
			sum ^= x&1;
		}
		
		if(sum)ok = mid;
		else ng = mid;
		
	}
	
	cout<<ok<<endl;
	
	return 0;
}
0