結果

問題 No.2709 1975 Powers
コンテスト
ユーザー 👑 loop0919
提出日時 2024-03-31 13:49:56
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 266 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 80,896 KB
最終ジャッジ日時 2024-09-30 18:28:18
合計ジャッジ時間 4,713 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 1 TLE * 1 -- * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

N, P, Q = map(int, input().split())
A = sorted(map(int, input().split()))

ans = 0
for a, b, c, d in combinations(A, r=4):
    if (pow(10, a, P) + pow(9, b, P) + pow(7, c, P) + pow(5, d, P)) % P == Q:
        ans += 1

print(ans)
0