結果
| 問題 |
No.814 ジジ抜き
|
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2019-04-12 22:18:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 747 bytes |
| コンパイル時間 | 1,798 ms |
| コンパイル使用メモリ | 169,212 KB |
| 実行使用メモリ | 10,240 KB |
| 最終ジャッジ日時 | 2024-09-14 19:54:25 |
| 合計ジャッジ時間 | 6,197 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
int main() {
cin.tie(nullptr); ios::sync_with_stdio(false);
int n; cin >> n;
V<lint> k(n), l(n), d(n); for (int i = 0; i < n; ++i) cin >> k[i] >> l[i] >> d[i];
auto chk = [&](lint x) -> bool {
lint s = 0;
for (int i = 0; i < n; ++i) {
s += max(min(l[i] + (k[i] << d[i]), x + 1) - l[i], 0LL) + ~(~0LL << d[i]) >> d[i];
}
return s & 1;
};
for (int i = 1; i <= 10; ++i) {
cerr << i << ' ' << chk(i) << '\n';
}
lint ng = 0, ok = 1e18;
while (ok - ng > 1) {
lint mid = ng + ok >> 1;
(chk(mid) ? ok : ng) = mid;
}
cout << ok << '\n';
}
risujiroh