結果
問題 | No.814 ジジ抜き |
ユーザー |
![]() |
提出日時 | 2019-04-12 23:43:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 514 ms / 3,000 ms |
コード長 | 628 bytes |
コンパイル時間 | 545 ms |
コンパイル使用メモリ | 69,724 KB |
実行使用メモリ | 10,216 KB |
最終ジャッジ日時 | 2024-09-15 06:22:36 |
合計ジャッジ時間 | 9,364 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 23 |
ソースコード
#include <iostream>#include <vector>using lint = long long;struct Card {lint K, L;int D;};int main() {int N;std::cin >> N;std::vector<Card> cards(N);for (auto& c : cards) {std::cin >> c.K >> c.L >> c.D;}lint ok = 1LL << 60, ng = -1;while (ok - ng > 1) {lint mid = (ok + ng) / 2;lint num = 0;for (auto card : cards) {if (mid < card.L) continue;num += std::min((mid - card.L) / (1LL << card.D) + 1, card.K);}((num & 1) ? ok : ng) = mid;}std::cout << ok << std::endl;return 0;}