結果
問題 |
No.2709 1975 Powers
|
ユーザー |
![]() |
提出日時 | 2024-04-01 21:11:39 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 409 bytes |
コンパイル時間 | 209 ms |
コンパイル使用メモリ | 82,360 KB |
実行使用メモリ | 76,644 KB |
最終ジャッジ日時 | 2024-09-30 22:06:21 |
合計ジャッジ時間 | 4,109 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 1 TLE * 1 -- * 23 |
ソースコード
N,P,Q = map(int,input().split()) A = list(map(int,input().split())) cnt = 0 for i in range(0,N-3): a = pow(10,A[i],P) for j in range(i+1,N-2): b = pow(9,A[j],P) for k in range(j+1,N-1): c = pow(7,A[k],P) for l in range(k+1, N): d = pow(5,A[l],P) if (a+b+c+d)%P == Q: cnt += 1 print(cnt)