結果

問題 No.2709 1975 Powers
ユーザー n_nan_na
提出日時 2024-04-01 22:11:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 509 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 75,408 KB
最終ジャッジ日時 2024-04-01 22:11:16
合計ジャッジ時間 6,349 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 37 ms
53,460 KB
testcase_02 AC 54 ms
64,196 KB
testcase_03 AC 214 ms
75,332 KB
testcase_04 AC 319 ms
75,332 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 44 ms
59,852 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 46 ms
59,972 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 79 ms
72,388 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 355 ms
75,332 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 354 ms
75,332 KB
testcase_26 AC 361 ms
75,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P,Q = map(int,input().split())
A = list(map(int,input().split()))

R,S,T,U = [],[],[],[]
for a in A:
    R.append(pow(10,a,P))
    S.append(pow(9,a,P))
    T.append(pow(7,a,P))
    U.append(pow(5,a,P))

cnt = 0
for i in range(0,N-3):
    a = R[i]
    for j in range(i+1,N-2):
        b = S[j]
        for k in range(j+1,N-1):
            c = T[k]
            for l in range(k+1, N):
                d = U[l]
                z = (a+b+c+d)%P
                if z == Q:
                    cnt += 1
print(cnt)
0