Submission #71473359


Source Code Expand

N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
    for j in range(i+1, N):
        s = 0
        for k in range(i, j+1):
            s += A[k]

        flg = False
        for k in range(i, j+1):
            if s % A[k] == 0:
                flg = True
                break

        if not flg:
            ans += 1

print(ans)

Submission Info

Submission Time
Task B - No-Divisible Range
User kokonotsu
Language Python (PyPy 3.11-v7.3.20)
Score 200
Code Size 381 Byte
Status AC
Exec Time 65 ms
Memory 90340 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 2
AC × 25
Set Name Test Cases
Sample example_00.txt, example_01.txt
All example_00.txt, example_01.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, hand_07.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt
Case Name Status Exec Time Memory
example_00.txt AC 52 ms 79712 KiB
example_01.txt AC 51 ms 79724 KiB
hand_00.txt AC 57 ms 87392 KiB
hand_01.txt AC 60 ms 88796 KiB
hand_02.txt AC 60 ms 88620 KiB
hand_03.txt AC 63 ms 89848 KiB
hand_04.txt AC 65 ms 90340 KiB
hand_05.txt AC 54 ms 79644 KiB
hand_06.txt AC 54 ms 79588 KiB
hand_07.txt AC 62 ms 89244 KiB
random_00.txt AC 63 ms 89536 KiB
random_01.txt AC 64 ms 89672 KiB
random_02.txt AC 62 ms 88772 KiB
random_03.txt AC 62 ms 88680 KiB
random_04.txt AC 62 ms 88988 KiB
random_05.txt AC 60 ms 87484 KiB
random_06.txt AC 62 ms 89224 KiB
random_07.txt AC 61 ms 88052 KiB
random_08.txt AC 65 ms 89400 KiB
random_09.txt AC 63 ms 88336 KiB
random_10.txt AC 62 ms 88448 KiB
random_11.txt AC 62 ms 88076 KiB
random_12.txt AC 60 ms 87564 KiB
random_13.txt AC 63 ms 88960 KiB
random_14.txt AC 61 ms 88384 KiB