結果

問題 No.1666 累乗数
ユーザー とりゐとりゐ
提出日時 2021-09-03 14:35:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 755 ms / 2,000 ms
コード長 275 bytes
コンパイル時間 272 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 80,400 KB
最終ジャッジ日時 2023-08-21 19:06:33
合計ジャッジ時間 15,753 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 128 ms
78,108 KB
testcase_01 AC 755 ms
79,444 KB
testcase_02 AC 753 ms
80,400 KB
testcase_03 AC 754 ms
78,924 KB
testcase_04 AC 745 ms
78,440 KB
testcase_05 AC 706 ms
78,316 KB
testcase_06 AC 713 ms
78,388 KB
testcase_07 AC 713 ms
78,328 KB
testcase_08 AC 704 ms
78,276 KB
testcase_09 AC 735 ms
78,404 KB
testcase_10 AC 733 ms
78,328 KB
testcase_11 AC 742 ms
78,776 KB
testcase_12 AC 745 ms
79,036 KB
testcase_13 AC 715 ms
79,168 KB
testcase_14 AC 717 ms
79,140 KB
testcase_15 AC 718 ms
78,408 KB
testcase_16 AC 714 ms
78,440 KB
testcase_17 AC 722 ms
79,192 KB
testcase_18 AC 733 ms
79,296 KB
testcase_19 AC 733 ms
78,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
 k,n,o=int(input()),0,2**63
 while o-n>1:
  m,c=(o+n)//2,[0]*60
  for i in range(59,1,-1):
   N,O=int(2**(63/i))+1,0
   while N-O>1:
    M=(N+O)//2
    if M**i<=m:O=M
    else:N=M
   c[i]=O-1-sum(c[::i])
  if sum(c)+1>=k:o=m
  else:n=m
 print(o)
0