結果

問題 No.1819 Mirrored 2
ユーザー 👑 tamatotamato
提出日時 2022-01-21 22:30:44
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 548 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 87,468 KB
実行使用メモリ 76,212 KB
最終ジャッジ日時 2023-08-17 09:35:26
合計ジャッジ時間 7,184 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
75,868 KB
testcase_01 AC 70 ms
75,756 KB
testcase_02 AC 76 ms
75,824 KB
testcase_03 AC 68 ms
75,556 KB
testcase_04 AC 72 ms
75,644 KB
testcase_05 AC 72 ms
75,792 KB
testcase_06 AC 73 ms
75,752 KB
testcase_07 AC 71 ms
75,756 KB
testcase_08 AC 72 ms
75,580 KB
testcase_09 AC 73 ms
75,712 KB
testcase_10 AC 74 ms
75,612 KB
testcase_11 AC 70 ms
75,804 KB
testcase_12 AC 69 ms
76,212 KB
testcase_13 AC 77 ms
75,720 KB
testcase_14 AC 71 ms
75,532 KB
testcase_15 AC 70 ms
75,656 KB
testcase_16 AC 72 ms
75,612 KB
testcase_17 AC 71 ms
75,660 KB
testcase_18 AC 70 ms
75,648 KB
testcase_19 AC 72 ms
75,644 KB
testcase_20 AC 71 ms
75,672 KB
testcase_21 AC 71 ms
75,764 KB
testcase_22 AC 71 ms
75,548 KB
testcase_23 AC 71 ms
75,552 KB
testcase_24 AC 71 ms
75,672 KB
testcase_25 AC 70 ms
75,656 KB
testcase_26 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    P, Q, x, y = map(int, input().split())
    if y % 10 == 0:
        y += Q
    N = str(y)[::-1]
    m = int(N) % P
    if m != 0:
        while True:
            y += Q
            if y % 10 == 0:
                continue
            N = str(y)[::-1]
            m = int(N) % P
            if m:
                break

    cnt = 0
    while m != x:
        cnt += 1
        m = (m * 10)%P
    print(N + "0" * cnt)


if __name__ == '__main__':
    main()
0