結果
| 問題 | No.1819 Mirrored 2 | 
| コンテスト | |
| ユーザー |  titia | 
| 提出日時 | 2022-01-22 00:08:47 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 650 bytes | 
| コンパイル時間 | 110 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-11-26 07:18:17 | 
| 合計ジャッジ時間 | 2,609 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 23 WA * 2 RE * 1 | 
ソースコード
import sys
input = sys.stdin.readline
P,Q,x,y=map(int,input().split())
# N mod P = x
for tests in range(10**5):
    N=y+tests*Q
    REV=int(str(N)[::-1])
    kk=pow(REV,P-2,P)*x%P
    # 10**y == kk
    # modが素数の場合
    import math
    a = 10
    b = kk
    mod = P
    SQ = int(math.sqrt(mod))+1
    Powdict = {pow(a,i,mod):i for i in range(SQ)} # Baby-Step
    A = pow(pow(a,mod-2,mod),SQ,mod)
    for i in range(SQ): # Giant-Step
        if b*pow(A,i,mod)%mod in Powdict:
            ANS = i*SQ+Powdict[b*pow(A,i,mod)%mod]
            break
    XX=str(REV)+"0"*ANS
    if len(XX)<100000:
        print(XX)
        break
            
            
            
        