結果
| 問題 |
No.2709 1975 Powers
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-31 15:39:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 278 bytes |
| コンパイル時間 | 380 ms |
| コンパイル使用メモリ | 82,796 KB |
| 実行使用メモリ | 82,900 KB |
| 最終ジャッジ日時 | 2024-09-30 20:53:09 |
| 合計ジャッジ時間 | 4,897 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 1 TLE * 1 -- * 23 |
ソースコード
from itertools import combinations
N,P,Q=list(map(int,input().split()))
A=list(map(int,input().split()))
ans=0
for l in combinations(A,4):
a=l[0]
b=l[1]
c=l[2]
d=l[3]
x=pow(10,a,P)+pow(9,b,P)+pow(7,c,P)+pow(5,d,P)
x%=P
if x==Q:ans+=1
print(ans)