Submission #68128934


Source Code Expand

from collections import Counter

n = int(input())
a = list(map(int, input().split()))

results = [i - a[i] for i in range(n)]
counter = Counter(results)
ans = 0
for i in range(n):
    key = a[i] + i
    if key in counter:
        ans += counter[key]
print(ans)

Submission Info

Submission Time
Task C - Distance Indicators
User rainline
Language Python (CPython 3.11.4)
Score 300
Code Size 274 Byte
Status AC
Exec Time 112 ms
Memory 33632 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 29
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 11 ms 9252 KiB
00_sample_01.txt AC 11 ms 9240 KiB
00_sample_02.txt AC 11 ms 9252 KiB
01_random_03.txt AC 64 ms 27184 KiB
01_random_04.txt AC 75 ms 29108 KiB
01_random_05.txt AC 46 ms 20312 KiB
01_random_06.txt AC 81 ms 30000 KiB
01_random_07.txt AC 102 ms 33596 KiB
01_random_08.txt AC 104 ms 33536 KiB
01_random_09.txt AC 104 ms 33632 KiB
01_random_10.txt AC 104 ms 33548 KiB
01_random_11.txt AC 86 ms 30348 KiB
01_random_12.txt AC 29 ms 15316 KiB
01_random_13.txt AC 81 ms 30208 KiB
01_random_14.txt AC 26 ms 14260 KiB
01_random_15.txt AC 94 ms 33528 KiB
01_random_16.txt AC 88 ms 26948 KiB
01_random_17.txt AC 58 ms 22040 KiB
01_random_18.txt AC 16 ms 10936 KiB
01_random_19.txt AC 68 ms 23984 KiB
01_random_20.txt AC 112 ms 33608 KiB
01_random_21.txt AC 107 ms 31944 KiB
01_random_22.txt AC 107 ms 32040 KiB
01_random_23.txt AC 102 ms 31972 KiB
01_random_24.txt AC 71 ms 30920 KiB
01_random_25.txt AC 96 ms 28676 KiB
01_random_26.txt AC 95 ms 28584 KiB
01_random_27.txt AC 95 ms 28476 KiB
01_random_28.txt AC 95 ms 28448 KiB