結果
問題 |
No.897 compαctree
|
ユーザー |
|
提出日時 | 2021-06-27 23:06:00 |
言語 | Swift (6.0.3) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 340 bytes |
コンパイル時間 | 3,088 ms |
コンパイル使用メモリ | 184,940 KB |
実行使用メモリ | 16,128 KB |
最終ジャッジ日時 | 2024-06-25 11:56:27 |
合計ジャッジ時間 | 3,412 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
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) }