結果
問題 | No.2416 vs Slime |
ユーザー |
|
提出日時 | 2024-07-03 19:21:29 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 544 bytes |
コンパイル時間 | 1,185 ms |
コンパイル使用メモリ | 98,316 KB |
最終ジャッジ日時 | 2025-02-22 01:54:37 |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 24 WA * 13 |
ソースコード
#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); while (!slimes.empty()) { temp = slimes.begin()->first / A; if (temp != 0) slimes[temp] += 2; ans += slimes.begin()->second; slimes.erase(slimes.begin()); } cout << ans << '\n'; return 0; }