結果

問題 No.2416 vs Slime
ユーザー rinrion
提出日時 2023-08-12 15:04:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 256 bytes
コンパイル時間 3,983 ms
コンパイル使用メモリ 227,908 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-19 23:14:36
合計ジャッジ時間 5,212 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 37
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>	
using namespace std;
using namespace atcoder;

int main(){
	
	long long  h, a;
	cin >> h >> a;

	long long res = 0, now = 1;

	while(h > 0){
		res += now;
		h /= a;
		now *= 2;
	}
	
	cout << res << endl;


}
0