結果
問題 | No.2709 1975 Powers |
ユーザー |
![]() |
提出日時 | 2024-04-06 16:27:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,734 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 153 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 84,352 KB |
最終ジャッジ日時 | 2024-10-01 03:53:43 |
合計ジャッジ時間 | 21,115 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 25 |
ソースコード
import collectionsN,P,Q = map(int, input().split())A = list(map(int, input().split()))A.sort()ans = 0D = collections.defaultdict(int)for c in reversed(range(N)):for b in range(c):for a in range(b):ans += D[(Q-pow(7,A[c],P)-pow(9,A[b],P)-pow(10,A[a],P))%P]D[pow(5,A[c],P)]+=1print(ans)