結果

問題 No.1819 Mirrored 2
ユーザー SumitacchanSumitacchan
提出日時 2022-01-21 22:09:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 367 ms / 2,000 ms
コード長 377 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 76,932 KB
最終ジャッジ日時 2024-11-26 04:44:15
合計ジャッジ時間 6,615 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import random

def rev(N):
    s = str(N)
    s = s[::-1]
    return int(s)

if __name__ == '__main__':
    P, Q, x, y = map(int, input().split())
    while True:
        k = random.randint(0, 10**12)
        N = k * Q + y
        if N % 10 == 0:
            continue
        if rev(N) % P == x:
            ans = rev(N)
            break
    print(ans)
0