結果

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long; 

int main() {
    ll h, a;
    cin >> h >> a;
    int count=0;
    while(true) {
        h=h/a;
        if(h>0) {
            count++;
        }
        else {
            count++;
            break;
        }
    }
    ll ans=0;
    for(ll i=1; i<=count; i++) {
        ans+=i;
    }
    cout << ans << endl;
}
0