結果
問題 |
No.2709 1975 Powers
|
ユーザー |
|
提出日時 | 2024-03-31 15:10:34 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 328 bytes |
コンパイル時間 | 297 ms |
コンパイル使用メモリ | 82,108 KB |
実行使用メモリ | 178,776 KB |
最終ジャッジ日時 | 2024-09-30 20:21:43 |
合計ジャッジ時間 | 3,931 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | TLE * 1 -- * 24 |
ソースコード
from itertools import combinations def count_ways(N, P, Q, A): ways = 0 for a, b, c, d in combinations(range(N), 4): if (10**A[a] + 9**A[b] + 7**A[c] + 5**A[d]) % P == Q: ways += 1 return ways N, P, Q = map(int, input().split()) A = list(map(int, input().split())) print(count_ways(N, P, Q, A))