結果

問題 No.1819 Mirrored 2
ユーザー ygd.ygd.
提出日時 2022-01-21 22:37:54
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 961 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 75,964 KB
最終ジャッジ日時 2023-08-17 09:40:35
合計ジャッジ時間 4,254 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,432 KB
testcase_01 AC 79 ms
75,400 KB
testcase_02 AC 84 ms
75,516 KB
testcase_03 AC 81 ms
75,604 KB
testcase_04 AC 79 ms
75,520 KB
testcase_05 AC 81 ms
75,724 KB
testcase_06 AC 81 ms
75,500 KB
testcase_07 AC 83 ms
75,544 KB
testcase_08 AC 82 ms
75,528 KB
testcase_09 AC 83 ms
75,604 KB
testcase_10 AC 84 ms
75,384 KB
testcase_11 AC 81 ms
75,724 KB
testcase_12 AC 83 ms
75,560 KB
testcase_13 AC 82 ms
75,520 KB
testcase_14 AC 83 ms
75,720 KB
testcase_15 AC 80 ms
75,524 KB
testcase_16 AC 79 ms
75,580 KB
testcase_17 AC 81 ms
75,636 KB
testcase_18 AC 81 ms
75,564 KB
testcase_19 AC 83 ms
75,484 KB
testcase_20 AC 82 ms
75,424 KB
testcase_21 AC 80 ms
75,500 KB
testcase_22 AC 82 ms
75,528 KB
testcase_23 AC 82 ms
75,560 KB
testcase_24 AC 80 ms
75,568 KB
testcase_25 AC 79 ms
75,360 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)
            exit()
        v *= 10
        v %= P
        #print(v)
        
if __name__ == '__main__':
    main()
0