結果

問題 No.2709 1975 Powers
ユーザー 茅ヶ崎裕太茅ヶ崎裕太
提出日時 2024-03-31 15:00:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 406 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,348 KB
最終ジャッジ日時 2024-03-31 15:00:29
合計ジャッジ時間 10,522 ms
ジャッジサーバーID
(参考情報)
judge15 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,460 KB
testcase_01 AC 34 ms
53,460 KB
testcase_02 AC 48 ms
64,160 KB
testcase_03 AC 442 ms
75,296 KB
testcase_04 AC 723 ms
75,296 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 45 ms
59,844 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 46 ms
62,128 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 115 ms
72,352 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 844 ms
75,296 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 836 ms
75,296 KB
testcase_26 AC 837 ms
75,296 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,P,Q=map(int,input().split())
A=list(map(int,input().split()))
L=[[0 for _ in range(4)]for _ in range(N)]
for i in range(N):
    for j in range(4):
        L[i][j]=pow([10,9,7,5][j],A[i],P)

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