結果

問題 No.1819 Mirrored 2
ユーザー ygd.ygd.
提出日時 2022-01-21 22:36:10
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 942 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 87,332 KB
実行使用メモリ 75,904 KB
最終ジャッジ日時 2023-08-17 06:53:36
合計ジャッジ時間 4,115 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 80 ms
75,736 KB
testcase_02 AC 79 ms
75,800 KB
testcase_03 AC 80 ms
75,608 KB
testcase_04 AC 81 ms
75,800 KB
testcase_05 AC 82 ms
75,808 KB
testcase_06 AC 82 ms
75,904 KB
testcase_07 AC 80 ms
75,704 KB
testcase_08 AC 82 ms
75,608 KB
testcase_09 AC 81 ms
75,700 KB
testcase_10 AC 81 ms
75,740 KB
testcase_11 AC 83 ms
75,560 KB
testcase_12 AC 83 ms
75,688 KB
testcase_13 AC 80 ms
75,468 KB
testcase_14 AC 82 ms
75,596 KB
testcase_15 AC 82 ms
75,828 KB
testcase_16 AC 82 ms
75,684 KB
testcase_17 AC 80 ms
75,680 KB
testcase_18 AC 83 ms
75,732 KB
testcase_19 AC 80 ms
75,800 KB
testcase_20 AC 81 ms
75,836 KB
testcase_21 WA -
testcase_22 AC 80 ms
75,776 KB
testcase_23 AC 81 ms
75,720 KB
testcase_24 AC 79 ms
75,884 KB
testcase_25 AC 81 ms
75,904 KB
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline #文字列につけてはダメ
#input = sys.stdin.buffer.readline #文字列につけてはダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]


def main():
    P,Q,x,y = map(int,input().split())
    MAX = pow(10,5) + 100
    #1の位が0だとReverseできない
    if y%10 == 0:
        y += Q
    y = list(str(y))
    ry = list(reversed(y))
    ry = "".join(ry)
    ry = int(ry)
    v = ry%P
    for i in range(MAX):
        if v%P == x:
            ans = str(ry) + "0" * i
            print(ans)
        v *= 10
        v %= P
        #print(v)
        
if __name__ == '__main__':
    main()
0