結果

問題 No.897 compαctree
ユーザー kpinkcat
提出日時 2023-08-23 13:18:41
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 849 ms
コンパイル使用メモリ 101,104 KB
最終ジャッジ日時 2025-02-16 12:32:00
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<map>
#include<vector>
#include <algorithm>
#include<math.h>
#include <iomanip>
#include<set>
#include <numeric>
using namespace std;


int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++){
        long long n, k;
        cin >> n >> k;
        if (n <= k) cout << 1 << endl;
        else if (k != 1) cout << ceil(pow(n, 1./k)) << endl;
        else cout << n - 1 << endl;
    }
}
0