結果

問題 No.897 compαctree
ユーザー MaboyMaboy
提出日時 2021-06-27 23:06:00
言語 Swift
(5.10.0)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 340 bytes
コンパイル時間 1,932 ms
コンパイル使用メモリ 175,060 KB
実行使用メモリ 14,068 KB
最終ジャッジ日時 2023-09-07 18:09:33
合計ジャッジ時間 2,943 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
14,064 KB
testcase_01 AC 6 ms
13,428 KB
testcase_02 AC 6 ms
13,556 KB
testcase_03 AC 6 ms
13,924 KB
testcase_04 AC 5 ms
13,392 KB
testcase_05 AC 6 ms
13,624 KB
testcase_06 AC 6 ms
13,796 KB
testcase_07 AC 6 ms
13,648 KB
testcase_08 AC 6 ms
13,720 KB
testcase_09 AC 6 ms
13,664 KB
testcase_10 AC 6 ms
14,068 KB
testcase_11 AC 6 ms
13,816 KB
testcase_12 AC 6 ms
13,376 KB
testcase_13 AC 6 ms
13,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import Foundation
let q = Int(readLine()!)!
for _ in [Int](repeating: 0, count: q){
    var (t,m) = (-1,0)
    let n = readLine()!.split(separator: " ").map{Int($0)!}
    if n[1] == 1{
        t = n[0] - 1
    }else{
        while n[0] > m{
            t += 1
            m += Int(pow(Double(n[1]),Double(t)))
        }
    }
    print(t)
}
0