Submission #37647501


Source Code Expand

N, p, q = map(int, input().split())
A = list(map(int, input().split()))
A = [a % p for a in A]
ans = 0
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):
        for e in range(d+1, N):
          if A[a]*A[b]%p*A[c]%p*A[d]%p*A[e]%p == q:
            ans += 1

print(ans)

Submission Info

Submission Time
Task 055 - Select 5(★2)
User moshida
Language PyPy3 (7.3.0)
Score 2
Code Size 334 Byte
Status AC
Exec Time 955 ms
Memory 74556 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 2 / 2
Status
AC × 2
AC × 25
Set Name Test Cases
Sample sample01.txt, sample02.txt
All all_zero.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, hand_08.txt, hand_09.txt, hand_10.txt, hand_11.txt, max.txt, random_max00.txt, random_max01.txt, random_max02.txt, random_max03.txt, random_max04.txt, random_max05.txt, random_max06.txt, random_max07.txt, random_max08.txt, random_max09.txt, sample01.txt, sample02.txt
Case Name Status Exec Time Memory
all_zero.txt AC 449 ms 73772 KiB
hand_01.txt AC 52 ms 61916 KiB
hand_02.txt AC 49 ms 61820 KiB
hand_03.txt AC 435 ms 74060 KiB
hand_04.txt AC 836 ms 74092 KiB
hand_05.txt AC 449 ms 74404 KiB
hand_06.txt AC 723 ms 74388 KiB
hand_07.txt AC 955 ms 74556 KiB
hand_08.txt AC 858 ms 74356 KiB
hand_09.txt AC 864 ms 74476 KiB
hand_10.txt AC 839 ms 74028 KiB
hand_11.txt AC 846 ms 73900 KiB
max.txt AC 835 ms 73732 KiB
random_max00.txt AC 849 ms 74104 KiB
random_max01.txt AC 843 ms 74152 KiB
random_max02.txt AC 846 ms 74004 KiB
random_max03.txt AC 865 ms 74140 KiB
random_max04.txt AC 856 ms 74168 KiB
random_max05.txt AC 848 ms 74072 KiB
random_max06.txt AC 850 ms 74244 KiB
random_max07.txt AC 855 ms 74292 KiB
random_max08.txt AC 851 ms 74244 KiB
random_max09.txt AC 840 ms 74224 KiB
sample01.txt AC 50 ms 62020 KiB
sample02.txt AC 54 ms 62240 KiB