結果

問題 No.1819 Mirrored 2
ユーザー ああいいああいい
提出日時 2022-01-21 23:13:35
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 80,456 KB
最終ジャッジ日時 2023-08-17 07:48:47
合計ジャッジ時間 7,438 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
80,456 KB
testcase_01 AC 75 ms
75,720 KB
testcase_02 AC 80 ms
75,888 KB
testcase_03 AC 76 ms
75,652 KB
testcase_04 AC 76 ms
75,772 KB
testcase_05 AC 75 ms
75,708 KB
testcase_06 AC 78 ms
75,784 KB
testcase_07 AC 79 ms
75,688 KB
testcase_08 AC 77 ms
75,636 KB
testcase_09 AC 77 ms
75,768 KB
testcase_10 AC 76 ms
75,728 KB
testcase_11 WA -
testcase_12 AC 76 ms
75,684 KB
testcase_13 AC 78 ms
75,788 KB
testcase_14 AC 81 ms
75,792 KB
testcase_15 AC 79 ms
75,756 KB
testcase_16 AC 82 ms
75,536 KB
testcase_17 AC 82 ms
75,684 KB
testcase_18 AC 80 ms
75,784 KB
testcase_19 AC 79 ms
75,688 KB
testcase_20 AC 79 ms
75,568 KB
testcase_21 WA -
testcase_22 AC 77 ms
75,768 KB
testcase_23 AC 83 ms
75,608 KB
testcase_24 AC 80 ms
75,788 KB
testcase_25 AC 81 ms
75,752 KB
testcase_26 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

P,Q,x,y = input().split()

rQ = Q[::-1]
ry = y[::-1]
x = int(x)
P = int(P)
rry = int(ry)
inv = pow(rry,P-2,P)
rrQ = int(rQ)
u = inv * (x-rrQ) % P
s = len(Q) + 1
now = pow(10,s,P)
while now % P != u:
    s += 1
    now = now * 10 % P
ans = str(ry) + '0' * (s-len(Q)) + str(rQ)
print(ans)
0