結果
問題 |
No.1819 Mirrored 2
|
ユーザー |
|
提出日時 | 2022-01-21 23:10:45 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 265 bytes |
コンパイル時間 | 380 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 62,976 KB |
最終ジャッジ日時 | 2024-11-26 02:39:17 |
合計ジャッジ時間 | 5,781 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 23 WA * 2 TLE * 1 |
ソースコード
P,Q,x,y = input().split() rQ = Q[::-1] ry = y[::-1] x = int(x) P = int(P) ry = int(ry) inv = pow(ry,P-2,P) rQ = int(rQ) u = inv * (x-rQ) % P s = 1 now = 10 while now % P != u: s += 1 now = now * 10 % P ans = str(ry) + '0' * (s-len(Q)) + str(rQ) print(ans)