結果
問題 |
No.897 compαctree
|
ユーザー |
![]() |
提出日時 | 2019-12-22 20:38:03 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 285 bytes |
コンパイル時間 | 213 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-09-14 16:41:13 |
合計ジャッジ時間 | 1,346 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 |
ソースコード
def xxx(N,K): if K==1: return N-1 sm,dd=1,1 for n in range(10**9+1): if sm>=N: return n dd *=K sm +=dd return -1 def main(): Q=int(input()) for i in range(Q): N,K=map(int,input().split()) print(xxx(N,K)) main()