結果

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

ソースコード

diff #

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

vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}

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

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


}
0