結果

問題 No.2193 メガの下1桁
ユーザー shobonvipshobonvip
提出日時 2023-01-13 22:40:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 71,464 KB
最終ジャッジ日時 2023-08-26 04:24:34
合計ジャッジ時間 4,637 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,336 KB
testcase_01 AC 71 ms
71,244 KB
testcase_02 AC 70 ms
71,096 KB
testcase_03 AC 69 ms
71,172 KB
testcase_04 AC 69 ms
71,236 KB
testcase_05 AC 69 ms
71,392 KB
testcase_06 WA -
testcase_07 AC 69 ms
71,248 KB
testcase_08 WA -
testcase_09 AC 69 ms
71,192 KB
testcase_10 AC 70 ms
71,200 KB
testcase_11 AC 70 ms
71,108 KB
testcase_12 AC 70 ms
71,244 KB
testcase_13 AC 70 ms
71,320 KB
testcase_14 AC 70 ms
71,112 KB
testcase_15 AC 70 ms
71,036 KB
testcase_16 AC 70 ms
71,172 KB
testcase_17 AC 70 ms
71,244 KB
testcase_18 WA -
testcase_19 AC 69 ms
71,040 KB
testcase_20 AC 69 ms
71,320 KB
testcase_21 WA -
testcase_22 AC 70 ms
71,108 KB
testcase_23 AC 69 ms
71,124 KB
testcase_24 AC 70 ms
71,336 KB
testcase_25 AC 70 ms
71,288 KB
testcase_26 AC 69 ms
71,176 KB
testcase_27 AC 68 ms
71,056 KB
testcase_28 AC 68 ms
71,036 KB
testcase_29 WA -
testcase_30 AC 70 ms
71,392 KB
testcase_31 WA -
testcase_32 AC 69 ms
71,008 KB
testcase_33 AC 69 ms
71,416 KB
testcase_34 AC 69 ms
71,228 KB
testcase_35 AC 69 ms
71,320 KB
testcase_36 AC 70 ms
71,284 KB
testcase_37 AC 69 ms
71,316 KB
testcase_38 AC 70 ms
71,176 KB
testcase_39 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

m = int(input())
d = int(input())
n = int(input())
b = int(input())
v = [[0] * b for i in range(60)]
for i in range(b):
	if (i+d)%b != 0:
		v[0][i] = pow(i+d, i, b)
	else:
		v[0][i] = 0

for i in range(59):
	for j in range(b):
		v[i+1][j] = v[i][v[i][j]]

m %= b
if n == 0 and m == 0 and d == 0:
	print(0)
	exit()

if m == 0 and d == 0:
	n -= 1
	m = 1

for i in range(60):
	if (n >> i) & 1:
		m = v[i][m]

r = '0123456789ABCDEFG'

print(r[m])
0