結果
問題 | No.2416 vs Slime |
ユーザー |
![]() |
提出日時 | 2023-08-16 02:04:05 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 453 bytes |
コンパイル時間 | 1,992 ms |
コンパイル使用メモリ | 191,812 KB |
最終ジャッジ日時 | 2025-02-16 08:37:30 |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 37 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define ll long long#define rep(i, a, n) for (int i = (int)(a); i < (int)(n); i++)#define rrep(i, n, a) for (int i = (int)(n); i >= (int)(a); i--)void solve(){ll h,a; cin >> h >> a;ll ans = 0;ll j = 1;while(h>0){h = h/a;ans += j;j *= 2;}cout << ans;}int main(){ios::sync_with_stdio(false);cin.tie(0);solve();return 0;}