結果
| 問題 | No.2709 1975 Powers |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-31 15:45:37 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 422 bytes |
| 記録 | |
| コンパイル時間 | 226 ms |
| コンパイル使用メモリ | 95,952 KB |
| 実行使用メモリ | 84,480 KB |
| 最終ジャッジ日時 | 2026-09-07 00:06:55 |
| 合計ジャッジ時間 | 37,099 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 TLE * 7 |
ソースコード
from itertools import combinations
N,P,Q=list(map(int,input().split()))
A=list(map(int,input().split()))
A.sort()
M=[[0 for _ in range(4)] for _ in range(N)]
for (i,a) in enumerate(A):
M[i][0]=pow(10,a,P)
M[i][1]=pow(9,a,P)
M[i][2]=pow(7,a,P)
M[i][3]=pow(5,a,P)
ans=0
for l in combinations(list(range(N)),4):
x=0
for i in range(4):
x+=M[l[i]][i]
x%=P
if x==Q:ans+=1
print(ans)