結果

問題 No.1232 2^x = x
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-09-18 23:47:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 514 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 86,732 KB
実行使用メモリ 76,040 KB
最終ジャッジ日時 2023-09-04 12:00:57
合計ジャッジ時間 1,875 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,236 KB
testcase_01 AC 99 ms
76,040 KB
testcase_02 AC 102 ms
76,040 KB
testcase_03 AC 100 ms
75,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#test

def inverse(a,mod): #aのmodを法にした逆元を返す
    return pow(a,mod-2,mod)

N = int(input())

for i in range(N):

    p = int(input())

    if p == 2:
        print (2)
    else:
        print ((p-1) * inverse(p-1,p))

"""
for i in range(100):

    ans = []
    f2 = True
    flag = False
    bl = None
    for j in range(i):
        if (2**j % i == j):
            flag = True
            bl = j
        if j > 1 and i % j == 0:
            f2 = False
    if f2:
        print (i,flag,bl)
"""
0