結果

問題 No.2416 vs Slime
コンテスト
ユーザー elphe
提出日時 2024-07-03 19:20:18
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 519 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3,192 ms
コンパイル使用メモリ 109,976 KB
実行使用メモリ 9,284 KB
最終ジャッジ日時 2026-07-05 02:37:36
合計ジャッジ時間 2,250 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1
other AC * 18 WA * 19
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <map>
#include <functional>

using namespace std;

int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    long long H, A, temp;
    int ans = 0;
    map<long long, int, greater<long long>> slimes;
    cin >> H >> A;
    slimes.emplace(H, 1);

    for (ans = 0; !slimes.empty(); ++ans)
    {
        temp = slimes.begin()->first / A;
        if (temp != 0)
            slimes[temp] += 2;
        slimes.erase(slimes.begin());
    }

    cout << ans << '\n';
    return 0;
}
0