提出 #71483780


ソースコード 拡げる

import sys
N = int(sys.stdin.readline())
A = [0] +  [int(a) for a in sys.stdin.readline().split()]

ans = 0
for l in range(1, N + 1):
    for r in range(l , N + 1):
        cnt = 1
        s = sum(A[l : r+1])
        for i in range(l , r+1):
            if s % A[i]  == 0 :
                cnt = 0
                break
        ans += cnt

print(ans)

提出情報

提出日時
問題 B - No-Divisible Range
ユーザ tariaki
言語 Python (CPython 3.13.7)
得点 200
コード長 369 Byte
結果 AC
実行時間 14 ms
メモリ 9292 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 200 / 200
結果
AC × 2
AC × 25
セット名 テストケース
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
ケース名 結果 実行時間 メモリ
example_00.txt AC 11 ms 9084 KiB
example_01.txt AC 11 ms 9008 KiB
hand_00.txt AC 12 ms 9232 KiB
hand_01.txt AC 14 ms 9168 KiB
hand_02.txt AC 13 ms 9116 KiB
hand_03.txt AC 12 ms 9116 KiB
hand_04.txt AC 13 ms 9228 KiB
hand_05.txt AC 11 ms 9220 KiB
hand_06.txt AC 11 ms 9116 KiB
hand_07.txt AC 13 ms 9128 KiB
random_00.txt AC 13 ms 9224 KiB
random_01.txt AC 13 ms 9220 KiB
random_02.txt AC 12 ms 9008 KiB
random_03.txt AC 13 ms 9168 KiB
random_04.txt AC 12 ms 9008 KiB
random_05.txt AC 13 ms 9220 KiB
random_06.txt AC 13 ms 9116 KiB
random_07.txt AC 13 ms 9008 KiB
random_08.txt AC 13 ms 9292 KiB
random_09.txt AC 13 ms 9008 KiB
random_10.txt AC 14 ms 9008 KiB
random_11.txt AC 13 ms 9220 KiB
random_12.txt AC 13 ms 9220 KiB
random_13.txt AC 13 ms 9168 KiB
random_14.txt AC 13 ms 9196 KiB