結果

問題 No.814 ジジ抜き
ユーザー 沙耶花沙耶花
提出日時 2020-12-08 16:56:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 662 bytes
コンパイル時間 6,078 ms
コンパイル使用メモリ 203,944 KB
実行使用メモリ 10,452 KB
最終ジャッジ日時 2023-10-17 17:20:48
合計ジャッジ時間 23,025 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 7 ms
4,348 KB
testcase_04 TLE -
testcase_05 TLE -
testcase_06 AC 502 ms
10,188 KB
testcase_07 AC 194 ms
6,756 KB
testcase_08 AC 425 ms
10,188 KB
testcase_09 AC 324 ms
8,340 KB
testcase_10 AC 442 ms
9,924 KB
testcase_11 AC 471 ms
10,188 KB
testcase_12 AC 186 ms
6,756 KB
testcase_13 AC 200 ms
6,756 KB
testcase_14 AC 339 ms
8,604 KB
testcase_15 AC 153 ms
5,964 KB
testcase_16 AC 124 ms
5,964 KB
testcase_17 AC 338 ms
8,868 KB
testcase_18 AC 295 ms
8,076 KB
testcase_19 AC 394 ms
10,188 KB
testcase_20 AC 245 ms
6,756 KB
testcase_21 AC 239 ms
7,284 KB
testcase_22 AC 381 ms
9,192 KB
testcase_23 AC 179 ms
6,228 KB
testcase_24 AC 358 ms
8,340 KB
testcase_25 AC 247 ms
7,284 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){
			long long x = (1LL<<D[i]);
			long long ok1 = 0,ng1 = K[i]+1;
			while(ng1-ok1>1){
				long long mid1 = (ok1+ng1)/2;
				if(L[i] + x * (mid1-1)<=mid)ok1 = mid1;
				else ng1 = mid1;
			}
			sum ^= ok1&1;
		}
		
		if(sum)ok = mid;
		else ng = mid;
		
	}
	
	cout<<ok<<endl;
	
	return 0;
}
0