結果

問題 No.2709 1975 Powers
ユーザー detteiuudetteiuu
提出日時 2024-04-11 01:56:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 564 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 76,416 KB
最終ジャッジ日時 2024-04-11 01:56:34
合計ジャッジ時間 10,207 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
52,352 KB
testcase_01 AC 34 ms
52,480 KB
testcase_02 AC 45 ms
62,592 KB
testcase_03 AC 396 ms
75,884 KB
testcase_04 AC 687 ms
75,976 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 38 ms
59,520 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 37 ms
60,416 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 100 ms
71,168 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 838 ms
75,768 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 820 ms
75,776 KB
testcase_26 AC 753 ms
75,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

MOD = [[0]*4 for _ in range(N)]
for i in range(N):
    MOD[i][0] = pow(10, A[i], P)
    MOD[i][1] = pow(9, A[i], P)
    MOD[i][2] = pow(7, A[i], P)
    MOD[i][3] = pow(5, A[i], P)

ans = 0
for i in range(N-3):
    for j in range(i+1, N-2):
        for k in range(j+1, N-1):
            for l in range(k+1, N):
                if (MOD[i][0]+MOD[j][1]+MOD[k][2]+MOD[l][3]) % P == Q:
                    ans += 1

print(ans)
0