結果

問題 No.2709 1975 Powers
ユーザー sasa8uyauyasasa8uyauya
提出日時 2024-04-05 13:53:07
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 325 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 203,868 KB
最終ジャッジ日時 2024-04-05 13:53:32
合計ジャッジ時間 24,784 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 121 ms
103,324 KB
testcase_03 AC 1,118 ms
131,896 KB
testcase_04 AC 1,728 ms
181,308 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 47 ms
65,364 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 50 ms
66,260 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 331 ms
100,572 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 TLE -
testcase_23 TLE -
testcase_24 WA -
testcase_25 AC 1,994 ms
170,268 KB
testcase_26 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,p,q=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
r=[[0]*p for i in range(n)]
for i in range(n):
  for j in range(i+1):
    r[j][pow(5,a[i],p)]+=1
g=0
for i in range(n-3):
  for j in range(i+1,n-2):
    for k in range(j+1,n-1):
      g+=r[k+1][(q-pow(10,a[i],p)-pow(9,a[j],p)-pow(7,a[i],p))%p]
print(g)
0