結果

問題 No.2709 1975 Powers
ユーザー flippergo
提出日時 2025-07-15 10:40:25
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 246 bytes
コンパイル時間 509 ms
コンパイル使用メモリ 82,708 KB
実行使用メモリ 75,700 KB
最終ジャッジ日時 2025-07-15 10:40:31
合計ジャッジ時間 5,806 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 1 TLE * 1 -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations
N,P,Q = map(int,input().split())
A = sorted(list(map(int,input().split())))
ans = 0
for x in combinations(A,4):
    if (pow(10,x[0],P)+pow(9,x[1],P)+pow(7,x[2],P)+pow(5,x[3],P))%P==Q:
        ans += 1
print(ans)
0