結果

問題 No.757 チャンパーノウン定数 (2)
ユーザー 👑 kmjpkmjp
提出日時 2018-12-04 23:26:41
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 1,311 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 1,467 ms
コンパイル使用メモリ 77,404 KB
実行使用メモリ 86,456 KB
最終ジャッジ日時 2023-09-22 20:16:29
合計ジャッジ時間 20,155 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
77,400 KB
testcase_01 AC 75 ms
76,460 KB
testcase_02 AC 79 ms
76,172 KB
testcase_03 AC 77 ms
76,388 KB
testcase_04 AC 80 ms
77,212 KB
testcase_05 AC 81 ms
77,380 KB
testcase_06 AC 82 ms
77,476 KB
testcase_07 AC 76 ms
76,292 KB
testcase_08 AC 83 ms
77,600 KB
testcase_09 AC 82 ms
77,564 KB
testcase_10 AC 77 ms
76,168 KB
testcase_11 AC 77 ms
76,476 KB
testcase_12 AC 77 ms
76,452 KB
testcase_13 AC 81 ms
77,228 KB
testcase_14 AC 81 ms
77,424 KB
testcase_15 AC 81 ms
77,400 KB
testcase_16 AC 76 ms
76,540 KB
testcase_17 AC 81 ms
77,648 KB
testcase_18 AC 80 ms
77,284 KB
testcase_19 AC 77 ms
76,516 KB
testcase_20 AC 77 ms
76,428 KB
testcase_21 AC 75 ms
76,328 KB
testcase_22 AC 79 ms
77,224 KB
testcase_23 AC 78 ms
77,532 KB
testcase_24 AC 79 ms
77,396 KB
testcase_25 AC 76 ms
76,356 KB
testcase_26 AC 81 ms
77,636 KB
testcase_27 AC 80 ms
77,540 KB
testcase_28 AC 937 ms
81,976 KB
testcase_29 AC 730 ms
80,988 KB
testcase_30 AC 91 ms
79,044 KB
testcase_31 AC 102 ms
79,352 KB
testcase_32 AC 82 ms
77,732 KB
testcase_33 AC 112 ms
78,644 KB
testcase_34 AC 284 ms
79,368 KB
testcase_35 AC 92 ms
78,904 KB
testcase_36 AC 91 ms
78,952 KB
testcase_37 AC 540 ms
80,184 KB
testcase_38 AC 770 ms
81,504 KB
testcase_39 AC 1,011 ms
83,064 KB
testcase_40 AC 1,256 ms
86,456 KB
testcase_41 AC 908 ms
81,648 KB
testcase_42 AC 507 ms
78,860 KB
testcase_43 AC 1,311 ms
80,932 KB
testcase_44 AC 948 ms
81,424 KB
testcase_45 AC 662 ms
80,052 KB
testcase_46 AC 912 ms
79,632 KB
testcase_47 AC 808 ms
80,652 KB
testcase_48 AC 491 ms
79,320 KB
testcase_49 AC 691 ms
80,468 KB
testcase_50 AC 82 ms
77,348 KB
testcase_51 AC 81 ms
77,768 KB
testcase_52 AC 75 ms
76,260 KB
testcase_53 AC 75 ms
76,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #


def Sn(n):
	bn = B**n
	return n*bn - (bn-1)/(B-1)

B=int(raw_input())
C=raw_input().strip()
D=0
for c in C:
	D=D*B+(ord(c)-ord('0'))

D-=1
L=0
for i in range(16,-1,-1):
	if Sn(L+(1<<i))<=D:
		L += 1<<i

D -= Sn(L)
L += 1

mo = D % L
D = (B**(L-1)) + D/L

D /= B**(L-1-mo)
print str(D%B)
0