結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 55 ms
64,164 KB
testcase_03 AC 445 ms
75,300 KB
testcase_04 AC 724 ms
75,300 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 41 ms
59,848 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 44 ms
62,132 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 110 ms
72,356 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 845 ms
75,300 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 843 ms
75,300 KB
testcase_26 AC 816 ms
75,300 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)]
t=[10,9,7,5]
for i in range(N):#前計算 O(800*powのやつ)
    for j in range(4):
        L[i][j]=pow(t[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