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