結果

問題 No.2709 1975 Powers
ユーザー ButterflvButterflv
提出日時 2024-04-18 10:32:25
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 149 ms
コンパイル使用メモリ 82,096 KB
実行使用メモリ 76,488 KB
最終ジャッジ日時 2024-04-18 10:32:34
合計ジャッジ時間 6,923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,672 KB
testcase_01 AC 35 ms
52,688 KB
testcase_02 AC 52 ms
64,676 KB
testcase_03 AC 262 ms
75,740 KB
testcase_04 AC 399 ms
75,772 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 39 ms
60,992 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 39 ms
60,452 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 87 ms
73,744 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 451 ms
75,744 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 451 ms
75,764 KB
testcase_26 AC 476 ms
76,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, P, Q=map(int, input().split())
A=list(map(int, input().split()))
_10=[]
_9=[]
_7=[]
_5=[]
ans=0
for i in range(N):
  _10.append(pow(10, A[i], P))
  _9.append(pow(9, A[i], P))
  _7.append(pow(7, A[i], P))
  _5.append(pow(5, A[i], P))
for a in range(N):
  for b in range(a+1, N):
    for c in range(b+1, N):
      for d in range(c+1, N):
        if (_10[a]+_9[b]+_7[c]+_5[d])%P==Q:
          ans+=1
print(ans)
0