problem_id stringlengths 6 6 | user_id stringlengths 10 10 | time_limit float64 1k 8k | memory_limit float64 262k 1.05M | problem_description stringlengths 48 1.55k | codes stringlengths 35 98.9k | status stringlengths 28 1.7k | submission_ids stringlengths 28 1.41k | memories stringlengths 13 808 | cpu_times stringlengths 11 610 | code_sizes stringlengths 7 505 |
|---|---|---|---|---|---|---|---|---|---|---|
p02689 | u932868243 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['n,m=map(int,input().split())\nh=list(map(int,input().split()))\nab=[list(map(int,input().split())) for _ in range(m)]\nlist=[0]*n\nfor a,b in ab:\n list[a-1]+=max(list[a-1],h[b-1])\n list[b-1]+=max(list[b-1],h[a-1])\ncount=0\nfor i in range(n):\n if list[i]<h[i]:\n count+=1\nprint(count)', 'n,m=map(int,input().... | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s056956532', 's409873304', 's738660066', 's779617384', 's694123933'] | [35204.0, 35252.0, 40512.0, 9124.0, 29480.0] | [467.0, 467.0, 285.0, 25.0, 396.0] | [283, 284, 446, 277, 291] |
p02689 | u941645670 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['n,m =map(int, input().split())\nh = list(map(int, input().split()))\nab = [list(map(int, input().split())) for _ in range(m)]\na, b = [list(i) for i in zip(*ab)]\ntest = []\nfor i in range(1,n+1):\n check = [j[1] for j in ab if j[0] == i] + [j[0] for j in ab if j[1] == i]\n check = list(set(check))\n test.ap... | ['Wrong Answer', 'Accepted'] | ['s815151586', 's775053619'] | [39884.0, 39968.0] | [2206.0, 320.0] | [529, 420] |
p02689 | u942051624 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N,M=map(int, input().split())\nH=list(map(int,input().split()))\nList=[list(map(int,input().split())) for i in range(M)]\n\nsup_list=[1 for i in range(N)]\n\nfor j in range(M):\n if H[List[j][0]-1]>H[List[j][1]-1]:\n sup_list[List[j][1]-1]=0\n elif H[List[j][0]-1]==H[List[j][1]-1]:\n sup_list[List... | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s265854564', 's544987621', 's409855579'] | [32652.0, 568224.0, 31928.0] | [320.0, 2221.0, 319.0] | [433, 457, 418] |
p02689 | u944643608 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nans = []\ncount = 0\nfor i in range(M):\n A, B = map(int, input().split())\n if (A not in ans) and (B not in ans):\n count += 1\n ans.append(A)\n ans.append(B)\n elif A not in ans:\n ans.append(A)\n elif B not in ans:\n ans.app... | ['Wrong Answer', 'Accepted'] | ['s946881888', 's145192539'] | [20028.0, 20040.0] | [2206.0, 259.0] | [324, 302] |
p02689 | u947047288 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N, M = map(int, input().split())\nHi = list(map(int,input().split(" ")))\npath = [list() for _ in range(M+1)]\n\nfor i in range(M):\n a, b = map(int, input().split())\n a -= 1\n b -= 1\n path[a].append(b)\n path[b].append(a)\n \n\ngoodT = 0\nT = range(M)\n\nfor i, p in zip(T, path):\n good = 1\n ... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s127471025', 's866267087', 's515058661'] | [29476.0, 8876.0, 20088.0] | [402.0, 24.0, 316.0] | [467, 469, 386] |
p02689 | u947327691 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['n,m=map(int,input().split())\nl=list(map(int,input().split()))\ntmp=[0]*n\n\nfor i in range(m):\n a,b=map(int,input().split())\n if l[a-1] >= l[b-1]:\n tmp[b-1]=-1\n if l[a-1] <= l[b-1]\n tmp[a-1]=-1\n\nprint(tmp.count(0))', 'n,m=map(int,input().split())\nl=list(map(int,input().split()))\ntmp=[... | ['Runtime Error', 'Accepted'] | ['s343938372', 's797425922'] | [9056.0, 20036.0] | [23.0, 247.0] | [234, 290] |
p02689 | u949618949 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ["import sys\nimport os\nf = open('input.txt', 'r')\nsys.stdin = f\n\nN, M = map(int, input().split( ))\ni = 1\nViewH = {}\nH_list = input().split( )\ncountlist = []\nwhile i <= N:\n ViewH[i] = int(H_list[i-1])\n countlist.append(0)\n i += 1\n\n\nfor count in range(M - 1):\n A, B = map(int, input().split())... | ['Runtime Error', 'Accepted'] | ['s658142203', 's795147778'] | [9156.0, 30940.0] | [25.0, 333.0] | [506, 513] |
p02689 | u950825280 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['n, m = map(int, input().split())\nh = list(map(int, input().split()))\nl = [[] for _ in range(n)]\nans = 0\nfor _ in range(m):\n a, b = map(int, input().split())\n l[a-1].append(h[b-1])\n l[b-1].append(h[a-1])\nprint(l)\nfor i, x in enumerate(l):\n s = h[i]\n if len(x) == 0:\n ans += 1\n ... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s210162454', 's739500992', 's873089729'] | [28936.0, 23164.0, 23092.0] | [374.0, 403.0, 397.0] | [362, 380, 367] |
p02689 | u954488273 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['import numpy as np\nn,m=list(map(int,input().split()))\nh=list(map(int,input().split()))\n\nflag=np.zeros(n)+1\n\nfor i in range(m):\n a,b=list(map(int,input().split()))\n if h[a-1]>h[b-1]:\n flag[b-1] = 0\n else:\n flag[a-1] = 0\n \nprint(flag)\nans=np.sum(flag)\nprint(int(ans))', 'import numpy as np\nn,... | ['Wrong Answer', 'Accepted'] | ['s170744699', 's527785418'] | [38328.0, 38656.0] | [351.0, 361.0] | [277, 324] |
p02689 | u955248595 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['import numpy as np\nN,M = (int(x) for x in input().split())\nH = np.array([int(x) for x in input().split()])\nWay = np.zeros((N,N),dtype=bool)\nfor T in range(0,M):\n A,B = (int(x) for x in input().split())\n Way[A-1,B-1] = True\n Way[B-1,A-1] = True\n \nCount = 0\n#for TT in range(0,N): \n# TrueInde... | ['Runtime Error', 'Accepted'] | ['s720935152', 's941091444'] | [38624.0, 29932.0] | [138.0, 450.0] | [431, 354] |
p02689 | u955865184 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['import sys\ndef input():\n return list(map(int, sys.stdin.readline().strip().split()))\n\nn, m = input()\nh = input()\ntmp = [[] for i in range(n)]\nfor i in range(m):\n a, b = input()\n tmp[b - 1].append(a - 1)\n tmp[a - 1].append(b - 1)\nans = 0\nfor i in range(n):\n flag = True\n for ele in tmp[i]:\n if(h... | ['Runtime Error', 'Accepted'] | ['s398188186', 's502018851'] | [9064.0, 29320.0] | [18.0, 362.0] | [367, 363] |
p02689 | u959307673 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N,M = map(int, input().split())\nH=list(map(int, input().split()))\nA=[]\nB=[]\nfor i in range(M):\n A1,B1=map(int, input().split())\n A.append(A1)\n B.append(B1)\nmiti={}\nfor i in range(M):\n if A[i] in miti:\n miti[A[i]].append(H[B[i]-1]) \n else:\n miti[A[i]]=[]\n mi... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s034950930', 's724684333', 's733200149'] | [39760.0, 39948.0, 33116.0] | [564.0, 526.0, 552.0] | [692, 691, 653] |
p02689 | u966207392 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N, M = map(int, input().split())\nH = list(map(int, input().split()))\n\nt = [0]*N\nfor i in range(M):\n a, b = map(int, input().split())\n t[a-1] = max(t[a-1], H[b-1])\n t[b-1] = max(t[b-1], H[a-1])\n\nres = 0\nfor i range(N):\n if H[i] > t[i]:\n res += 1\n\nprint(res) ', 'N, M = map(int, input().spl... | ['Runtime Error', 'Accepted'] | ['s530687580', 's210721501'] | [9060.0, 20040.0] | [21.0, 331.0] | [273, 276] |
p02689 | u971124021 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['h = list(map(int,input().split()))\nd = [1] * n\nfor i in range(m):\n a,b = list(map(int,input().split()))\n a -= 1\n b -= 1\n if h[a] > h[b]:\n d[b] = 0\n elif h[b] > h[a]:\n d[a] = 0\n else:\n d[a] = 0\n d[b] = 0\n\nprint(sum(d))', '\nn,m = list(map(int,input().split()))\nh = list(map(int,input().... | ['Runtime Error', 'Accepted'] | ['s781428053', 's179966496'] | [9104.0, 19960.0] | [29.0, 265.0] | [235, 273] |
p02689 | u981040490 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ["# -*- coding: utf-8 -*-\ndef main():\n N,M = map(int, input().split())\n H = list(map(int, input().split()))\n ans = []\n for _ in range(N):\n ans.append(1)\n for i in range(M):\n A,B = map(int, input().split())\n if H[A-1] < H[B-1]:\n ans[A-1] = -1\n elif H[A-1] ... | ['Wrong Answer', 'Accepted'] | ['s156426435', 's584466785'] | [20124.0, 20124.0] | [251.0, 241.0] | [464, 463] |
p02689 | u985374340 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['\nd = defaultdict(list)\n\nN, M = list(map(int, input().split()))\n\nH = list(map(int, input().split()))\n\nfor i in range(M):\n a, b = list(map(int, input().split()))\n d[a-1].append(b-1)\n d[b-1].append(a-1)\n\nans = 0\nfor i in range(N):\n ng = 0\n\n if(i not in d):\n ans += 1\n contin... | ['Runtime Error', 'Accepted'] | ['s133345171', 's232250450'] | [9164.0, 34416.0] | [21.0, 460.0] | [401, 437] |
p02689 | u987326700 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['n,m = map(int,input().split())\nh = list(map(int,input().split()))\na = []\nb = []\ncnt = 0\nwhile True:\n try:\n ta,tb = map(int,input().split())\n a.append(ta)\n b.append(tb)\n except:\n break\n\nhighest = h.index(max(h))+1\n\nfor i in range(1,m+1):\n if i not in a and i not in b:\n cnt +=1\n if ... | ['Wrong Answer', 'Accepted'] | ['s559061685', 's217629402'] | [22508.0, 22344.0] | [2206.0, 310.0] | [358, 424] |
p02689 | u995163736 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N, K = (int(i) for i in input().split())\nH = list(map(int,input().split()))\nans = [1]*N\nfor m in range(M):\n a, b = (int(i) for i in input().split())\n if H[a-1] < H[b-1]:\n ans[a-1] = 0\n elif H[a-1] > H[b-1]:\n ans[b-1] = 0\nprint(ans.count(1))', 'N, M = (int(i) for i in input().split())\nH = list(map(i... | ['Runtime Error', 'Accepted'] | ['s087209195', 's675238333'] | [20104.0, 20004.0] | [49.0, 265.0] | [249, 315] |
p02689 | u997927785 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ['N, M = map(int, input().split())\nH = list(map(int, input().split()))\nAB = []\nfor _ in range(M):\n AB.append(list(map(int, input().split())))\n\nprint(AB)\n\nfor d in range(0,M):\n if H[AB[d][0]-1] < H[AB[d][1]-1]:\n AB[d].pop(1)\n elif H[AB[d][0]-1] > H[AB[d][1]-1]:\n AB[d].pop(0)\n\nprint(A... | ['Wrong Answer', 'Accepted'] | ['s672976696', 's571670560'] | [35056.0, 34664.0] | [367.0, 333.0] | [398, 377] |
p02689 | u999799597 | 2,000 | 1,048,576 | There are N observatories in AtCoder Hill, called Obs. 1, Obs. 2, ..., Obs. N. The elevation of Obs. i is H_i. There are also M roads, each connecting two different observatories. Road j connects Obs. A_j and Obs. B_j. Obs. i is said to be good when its elevation is higher than those of all observatories that can be r... | ["def main():\n import collections\n n, m = map(int, input().split())\n hs = list(map(int, input().split()))\n nmap = [0] * n\n cnt = 0\n\n for j in range(m):\n v = input().split()\n v0 = int(v[0]) - 1\n v1 = int(v[1]) - 1\n if hs[v0] < hs[v1]:\n nmap[v0] += 1\n ... | ['Wrong Answer', 'Accepted'] | ['s621327759', 's228375834'] | [20536.0, 20492.0] | [235.0, 224.0] | [568, 548] |
p02691 | u008608569 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['\nn = int(input())\na = np.array(list(map(int, input().split())))\ncnt = 0\nfor i in range(1, n+1):\n for j in range(i+1, n+1):\n if abs(i-j) == (a[i-1]+a[j-1]):\n cnt += 1\nprint(cnt)', 'from collections import defaultdict\nn = int(input())\na = np.array(list(map(int, input().split())))\nci = de... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s721656819', 's733343449', 's450139222'] | [9192.0, 9392.0, 74072.0] | [23.0, 25.0, 359.0] | [222, 265, 255] |
p02691 | u020962106 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\nn = int(input())\na = list(map(int,input().split()))\nL = [0]*n\nR = [0]*n\ncnt=0\nfor i in range(n):\n L[i] = i+a[i]\n R[i] = i-a[i]\nz1=Counter(L)\nz2=Counter(R)\nprint(z1)\nprint(z2)\ncnt=0\nfor k1,v1 in z1.items():\n v2 = z2[k1]\n cnt += v1*v2\nprint(cnt)', 'from colle... | ['Wrong Answer', 'Accepted'] | ['s960066871', 's410347331'] | [87304.0, 63292.0] | [444.0, 268.0] | [287, 267] |
p02691 | u027357817 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["N,A,B,C=map(int,input().split())\n\nS=['']*N\nfor i in range(N):\n S[i]=input()\n\nresult=[]\nkekka=True\n\n\nfor i in range(N):\n if (A==0 and B==0 and S[i]=='AB') or (C==0 and B==0 and S[i]=='BC') or (A==0 and C==0 and S[i]=='AC'):\n kekka=False\n break\n else:\n if S[i]=='AB':\n ... | ['Runtime Error', 'Accepted'] | ['s754351426', 's211138120'] | [9260.0, 40312.0] | [25.0, 190.0] | [2523, 239] |
p02691 | u038724782 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\na_l = list(map(int,input().split()))\nia = list(enumerate(a_l))\ndel_l = []\nfor j in range(n):\n if ia[j][1] >= n-1:\n del_l.append(j)\nfor j in del_l[::-1]:\n del ia[j]\n \ncount = 0\ni = 0\nwhile True:\n if i > len(ia)-1:\n break\n i1, a1 = ia[i]\n if a1 >= n-1... | ['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s224048290', 's655652518', 's975855273', 's546942231'] | [42360.0, 42328.0, 32364.0, 74052.0] | [2207.0, 2206.0, 2206.0, 244.0] | [455, 524, 195, 414] |
p02691 | u039189422 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n=int(input())\nA=list(map(int,input().split()))\nB=[0]*(10**10)\nres=0\n\nfor i in range(n):\n\tB[A[i]+i]+=1\nfor i in range(n):\n\tif i-A[i]>0:\n\t\tres+=B[i-A[i]]\n\nprint(res)', 'from collections import defaultdict\n\nn=int(input())\nA=list(map(int,input().split()))\nB=defaultdict(int)\nres=0\n\nfor i in range(n)... | ['Runtime Error', 'Accepted'] | ['s086989373', 's076820502'] | [32228.0, 40704.0] | [65.0, 179.0] | [164, 189] |
p02691 | u044220565 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['# coding: utf-8\nimport sys\nsysread = sys.stdin.readline\nsys.setrecursionlimit(10**7)\n\ndef run():\n N = int(input())\n A = list(map(int, sysread().split()))\n\n import numpy as np\n N = 200000\n A = np.random.randint(1, N, size=N)\n\n A = [(idx, val) for idx, val in enumerate(A, 1) if val < N]\n... | ['Wrong Answer', 'Accepted'] | ['s255434645', 's262193376'] | [56852.0, 37420.0] | [365.0, 155.0] | [528, 451] |
p02691 | u045953894 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\nn = int(input())\na = list(map(int,input().split()))\ncount = 0\nb = []\nc = []\n\nfor i in range(n):\n b.append(a[i]+i)\n c.append(i-a[i])\nt = Counter(b)\nfor s in c:\n count += t[s]\n print(t[s],s)\nprint(t,1)\nprint(count)', 'from collections import Counter\nn = int(in... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s093999294', 's895579014', 's257472198'] | [70860.0, 70976.0, 50760.0] | [472.0, 468.0, 217.0] | [256, 256, 229] |
p02691 | u060896757 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\nA = [int(i) for i in input().split()]\ndp = [0] * (10 ** 9 + 2 * (10 ** 5))\nans = 0\nfor i in range(N):\n x = i + 1 - A[i]\n if x >= 0:\n ans += dp[x]\n dp[i + 1 + A[i]] += 1\n\nprint(ans)\n', 'N = int(input())\nA = [int(i) for i in input().split()]\ndp = [0] * 10 ** 7\nans = 0\nfor... | ['Runtime Error', 'Accepted'] | ['s253894874', 's720467562'] | [32336.0, 97968.0] | [72.0, 266.0] | [214, 230] |
p02691 | u064869465 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\na = list(map(int, input().split()))\nsu = dict()\nsd = dict()\nfor i in range(n):\n if a[i] + i + 1 in su:\n su[a[i] + i + 1] += 1\n else:\n su[a[i] + i + 1] = 1\n if a[i] - i - 1 in sd:\n sd[a[i] - i - 1] += 1\n else:\n sd[a[i] - i - 1] = 1\nf1 = []\nfor d in... | ['Runtime Error', 'Accepted'] | ['s338993264', 's832076159'] | [57356.0, 82324.0] | [267.0, 1074.0] | [638, 739] |
p02691 | u072717685 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["from collections import Counter\n\ndef main():\n n = int(input())\n a = list(map(int, input().split()))\n cnt = 0\n l1 = []\n for ea in a:\n l1.append(cnt - ea)\n cnt += 1\n l1c = Counter(l1)\n r = 0\n for ea2 in a:\n r += l1c[ea2 + a[ea2]]\n print(int(r))\n\nif __name_... | ['Runtime Error', 'Accepted'] | ['s863577470', 's973575795'] | [42552.0, 73732.0] | [160.0, 292.0] | [330, 446] |
p02691 | u094191970 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\n\nn=int(input())\na=list(map(int,input().split()))\n\nq1=[]\nq2=[]\n\nfor i in range(n):\n q1.append(i+a[i])\n q2.append(i-a[i])\n\nc2=Counter(q2)\n\nans=0\nfor i in c1.keys():\n ans+=c2[i]\n\nprint(ans)', 'from collections import Counter\n\nn=int(input())\na=list(map(int,input().s... | ['Runtime Error', 'Accepted'] | ['s466135886', 's932967453'] | [50588.0, 50704.0] | [167.0, 187.0] | [221, 202] |
p02691 | u114933382 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import numpy as np\nn = int(input())\nA = np.array(list(map(int,input().split())))\nB = np.array([i+1 for i in range(n)])\nC,D = A+B,B-A\nans = 0\nfor i in C:\n ans += np.count_nonzero(D==i)\n', 'import numpy as np\nimport collections\nn = int(input())\nA = np.array(list(map(int,input().split())))\nB = np.array([i... | ['Wrong Answer', 'Accepted'] | ['s828279837', 's493594900'] | [51004.0, 75124.0] | [2206.0, 410.0] | [187, 274] |
p02691 | u119148115 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\nA = list(map(int,input().split()))\nB = A\n\nfor i in range(N):\n A[i] -= i+1\n B[i] += i+1\n\nfrom collections import Counter\n\nC = Counter(A)\nD = Counter(B)\n\nE = list(C.keys())\nF = list(D.keys())\n\n\nans = 0\nfor i in E:\n ans += C[i]*D[i]\n\nprint(ans//2)', 'N = int(input())\nA = l... | ['Wrong Answer', 'Accepted'] | ['s753828053', 's129425672'] | [49440.0, 55736.0] | [272.0, 324.0] | [270, 291] |
p02691 | u127499732 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["def main():\n x = int(input())\n\n i = 0\n while True:\n j = i ** 5\n a1, a2 = x + j, x - j\n\n p = a1 ** (1 / 5)\n q = a2 ** (1 / 5) if a2 >= 0 else abs(a2) ** (1 / 5) * -1\n\n f = int(p) - p == 0\n g = int(q) - q == 0\n if f:\n print(int(p), i)\n ... | ['Wrong Answer', 'Accepted'] | ['s804504481', 's606531672'] | [9484.0, 89992.0] | [32.0, 371.0] | [442, 326] |
p02691 | u166340293 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N=int(input())\ncount=0\na=list(map(int,input().split()))\nw=[]\ns=[]\nmaxi=max(a)\nmini=min(a)\nnum=[0]*200000000\nmaxi=max(a)\nfor i in range(N):\n w.append(1+i+a[i])\n s.append(1+i-a[i])\n num[1+i-a[i]+maxi]+=1\nfor i in range(N):\n count+=num[w[i]+maxi]\nprint(count)', 'N=int(input())\ncount=0\na=list(map(int... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s050661279', 's062011021', 's271596473', 's379124814', 's627406755', 's812424769', 's822042175', 's879268304', 's145622815'] | [1597444.0, 9196.0, 39592.0, 38152.0, 801328.0, 1206700.0, 816128.0, 39632.0, 32240.0] | [2220.0, 25.0, 243.0, 239.0, 1102.0, 1746.0, 1241.0, 256.0, 181.0] | [260, 157, 293, 218, 264, 260, 224, 294, 226] |
p02691 | u179304833 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import numpy as np\nn=int(input())\na=list(map(int,input().split()))\na1=[]\na2=[]\nfor i in range(n):\n a1.append(i+1-a[i])\nfor i in range(n):\n a2.append(i+1+a[i])\ncount=0\np=0\nq=1\nwhile q==n:\n if a1[q]==a2[p]:\n count+=1\n p+=1\n if p==q:\n p=0\n q+=1\nprint(count)', 'from collections import Cou... | ['Wrong Answer', 'Accepted'] | ['s874237151', 's567487812'] | [51276.0, 50784.0] | [232.0, 192.0] | [268, 228] |
p02691 | u190735555 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n=int(input())\na=list(map(int, input().split()))\nb=[0]*n\nc=[0]*n\nfor i in range(n):\n b[i]=a[i]+i\n c[i]=i-a[i]\nbs=sorted(b)\ncs=sorted(c)\nlx=[1+10**10]*n\nly=[2+10**10]*n\nrx=[3+10**10]*n\nry=[4+10**10]*n\n\nlx[0]=1\nly[0]=bs[0]\nrx[0]=1\nry[0]=cs[0]\n\nd=0\ne=0\nfor j in range (1,n):\n if bs[j]==bs[j... | ['Wrong Answer', 'Accepted'] | ['s756812855', 's919639503'] | [43092.0, 43292.0] | [462.0, 509.0] | [684, 686] |
p02691 | u192154323 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from itertools import combinations\nn = int(input())\na_ls = list(map(int, input().split()))\nans = 0\ninds = [i for i in range(n)]\nfor ind_a, ind_b in combinations(inds, 2):\n Sum = a_ls[ind_a] + a_ls[ind_b]\n diff = abs(a-b)\n if Sum == diff:\n ans += 1\nprint(ans)', 'from collections import defaul... | ['Runtime Error', 'Accepted'] | ['s750187583', 's576435653'] | [32404.0, 61552.0] | [81.0, 271.0] | [274, 268] |
p02691 | u193264896 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["import sys\nimport numpy as np\nfrom numba import jit\nreadline = sys.stdin.buffer.readline\nsys.setrecursionlimit(10 ** 8)\nINF = float('inf')\nMOD = 10 ** 9 + 7\n\n\n\ndef main():\n N = int(input())\n H = np.array(input().split(), np.int64)\n A = np.arange(1,N+1)\n B = np.arange(1,N+1)\n A = A + H\n ... | ['Time Limit Exceeded', 'Accepted'] | ['s956776617', 's729017865'] | [158728.0, 74100.0] | [2209.0, 286.0] | [524, 507] |
p02691 | u197457087 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\n\nA = list(map(int, input().split()))\n\nL = {}\nR = {}\n\nfor i in range(N):\n t = A[i]+i\n if t in L:\n L[t] += 1\n else:\n L[t] = 1\n s = i - A[i]\n if s in R:\n R[s] += 1\n else:\n R[s] = 1 \nprint(L,R)\nans = 0\nfor i in range(N):\n t = A[i]+i\n \n if t in R.keys():\n a... | ['Wrong Answer', 'Accepted'] | ['s023065235', 's279782952'] | [56768.0, 56564.0] | [368.0, 247.0] | [345, 350] |
p02691 | u219015402 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['x = int(input())\ndef ans(x):\n for a in range(0, 1000)[::-1]:\n for b in range(-1000, 1000)[::-1]:\n if a**5 - b**5 == x:\n return a, b\na,b = ans(x)\nprint(a,b)', 'from collections import Counter\n\nN = int(input())\nalist = list(map(int, input().split()))\nalist = [0] + alist\ns... | ['Runtime Error', 'Accepted'] | ['s323171953', 's746302020'] | [9196.0, 42792.0] | [1373.0, 227.0] | [191, 405] |
p02691 | u221061152 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n=int(input())\nA=list(map(int,input().split()))\nL,R={},{}\nfor i,a in enumerate(A):\n l,r = i-a,i+a\n if l in L: L[l]=0\n if r in R: R[r]=0\n L[l]+=1\n R[r]+=1\n\ncount = 0\nfor x in L:\n if x not in R: continue\n count += L[x]*R[x]\nprint(count)', 'n=int(input())\nA=list(map(int,input().split()))\nL,R={},{}... | ['Runtime Error', 'Accepted'] | ['s189283135', 's074637195'] | [32328.0, 57344.0] | [67.0, 275.0] | [241, 249] |
p02691 | u241348301 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n=int(input())\ny=list(map(int,input().split()))\nfrom collections import Counter\nlhs=Counter([j+y[j] for j in range(n)])\nrhs=Counter([j-y[j] for j in range(n)])\ncount=0\nfor i in lhs:\n if i in rhs:\n count+=lhs[i]+rhs[i]\n\nprint(count)', 'n=int(input())\ny=list(map(int,input().split()))\nfrom collections... | ['Wrong Answer', 'Accepted'] | ['s164675376', 's742005940'] | [61452.0, 61268.0] | [189.0, 190.0] | [238, 239] |
p02691 | u246448955 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import collections\nN = int(input())\nA = list(map(int,input().split()))\n\n#index,h\npp =[]\npm = []\nall_set = set()\nfor i in range(N):\n\n pp.append(i + A[i])\n pm.append( i - A[i])\n\ncount = 0\nc = collections.Counter(pp)\n#print(c)\nfor i in range(N):\n count += c[pm[i]] \n print(c[pm[i]])\n\n #... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s013077276', 's382492294', 's277418122'] | [51024.0, 71176.0, 50524.0] | [325.0, 440.0, 225.0] | [366, 365, 367] |
p02691 | u265506056 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N=int(input())\nA=list(map(int,input().split()))\na=[]\nB=[]\nans=0\nfor i in range(1,N):\n b=A[i]+A[0]\n a.append(b-i)\n B.append(A[i]-A[0])\nans=a.counter(0)\nfor i in range(N):\n b=B[i]\n a1=a[i:].copy()\n a1=a1-[b-i-1]\n ans+=a1.counter(0)\nprint(ans)', 'import bisect\nN=int(input())\nA=list(... | ['Runtime Error', 'Accepted'] | ['s722876091', 's848463352'] | [34848.0, 35088.0] | [156.0, 434.0] | [261, 260] |
p02691 | u268181283 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\narr = map(int,input().split())\n_sum = []\n_del = []\nfor i in range(N):\n _sum.append(arr[i]+i+1)\n _del.append(i+1-arr[i])', 'N = int(input())\narr = list(map(int,input().split()))\ncnt_arr = [0]*N\nans = 0\nfor i in range(N):\n if arr[i]+i+1<N:\n cnt_arr[arr[i]+i+1] += 1\n if i+1-arr[i]>0:... | ['Runtime Error', 'Accepted'] | ['s763548940', 's837818954'] | [24788.0, 32272.0] | [41.0, 173.0] | [138, 206] |
p02691 | u268210555 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import *\nn = int(input())\na = list(map(int, input().split()))\nc = Counter()\nr = 0\nfor i in range(n):\n r += c[a[i]+i] \n c[i-a[i]] += 1\nprint(r)', 'from collections import *\nn = int(input())\na = list(map(int, input().split()))\nc = Counter(i-a[i] for i in range(n))\nr = 0\nfor i in rang... | ['Wrong Answer', 'Accepted'] | ['s901384776', 's380208974'] | [40604.0, 40720.0] | [224.0, 279.0] | [165, 189] |
p02691 | u268724304 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['# -*- coding: utf-8 -*-\n\nN = int(input())\nA = list(map(int, input().split()))\ncount=0\nL = [0]*N\nR = [0]*N\nhash_L=[0]*10000000000\nhash_R=[0]*10000000000\nfor i in range(N):\n L[i]=A[i]+i\n hash_L[L[i]]=L[i]\n R[i]=-A[i]+i\n hash_R[R[i]]=R[i]\n\nfor i in range(2*N):\n if hash_L[i]==hash_R[i]:\n ... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s153284381', 's367214245', 's758190972', 's789355822', 's322266675'] | [32240.0, 33304.0, 32196.0, 32376.0, 45980.0] | [69.0, 2229.0, 65.0, 2224.0, 360.0] | [347, 287, 346, 277, 755] |
p02691 | u279735925 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import defaultdict\n\nN = int(input())\t\n\n\n\nL = defaultdict(lambda: 0)\nR = defaultdict(lambda: 0)\nfor i, val in enumerate(map(int, input().split())):\n L[i - val] += 1\t\n R[i + val] += 1\t\n \nprint(L)\nprint("===")\nprint(R)\n\ncnt = 0\nfor key, val in L.items():\n if key > 0:\n cnt +=... | ['Wrong Answer', 'Accepted'] | ['s520262915', 's203074321'] | [61324.0, 61308.0] | [343.0, 258.0] | [499, 469] |
p02691 | u290886932 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\nA = list(map(int, input().split()))\n\nmax1 = max(A)\nA_ = A.copy()\nA_.remove(max1)\nmax2 = max(A_)\nln = max1 + max2\nret = 0\nfor i in range(len(A)-1):\n for j in range(i+1, i+ln + 1):\n if A[j] + A[i] == j - i:\n ret += 1\nprint(ret)', 'N = int(input())\nA_ = list(map(int, i... | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s419055466', 's460960159', 's641066644', 's302204174'] | [32376.0, 45020.0, 9160.0, 46296.0] | [2206.0, 2206.0, 22.0, 231.0] | [263, 353, 353, 345] |
p02691 | u298945776 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['\n\nimport bisect\nN = int(input())\nA = list(map(int, input().split()))\nX = [A[i]+i for i in range(N)]\nY = [j - A[j] for j in range(N)]\nans = 0\nX.sort()\nfor i in range(N):\n ans += bisect.bisect_left(Y,X[i]) - bisect.bisect_right(Y,X[i])\nprint(ans)\n\n\n', '\n\nimport bisect\nN = int(input())\nA = list(map(... | ['Wrong Answer', 'Accepted'] | ['s828108278', 's830980987'] | [33852.0, 33832.0] | [310.0, 331.0] | [642, 642] |
p02691 | u307592354 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['\n\ndef resolve():\n X= int(input())\n nums = dict()\n for A in range(10**4):\n nums[A**5] = A\n nums[-A**5] = -A \n\n if A**5 - X in nums:\n print(A,nums[A**5-X])\n \n \n\n\n\n \n\nif __name__ == "__main__":\n resolve()\n #unittest.main()', 'def ... | ['Wrong Answer', 'Accepted'] | ['s013673232', 's537756764'] | [11236.0, 40516.0] | [33.0, 161.0] | [290, 364] |
p02691 | u312078744 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["import itertools\nn = int(input())\na = list(map(int, input().split()))\nidList = [i for i in range(1, n+1)]\n'''\ncom = list(itertools.combinations(idList, 2))\n\nnum = len(com)\n'''\nans = 0\n\nfor i in range(n):\n for j in range(i + 1, n):\n key = j - i\n heiA = a[i - 1]\n heiB = a[j - 1]\n... | ['Wrong Answer', 'Accepted'] | ['s700707610', 's111233893'] | [32012.0, 76668.0] | [2206.0, 359.0] | [662, 548] |
p02691 | u312907447 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\n#cnt = 0\n\n# for j in range(i, N):\n\n# cnt += 1\n\nAp = [A[i]+i for i in range(len(A))]\nAm = [i-A[i] for i in range(len(A))]\n\nS = set(Ap) & set(Am)\n\nCp = Counter(Ap)\nCm = Counter(Am)\n\ncnt = 0\nfor i in S:\n cn... | ['Wrong Answer', 'Accepted'] | ['s295407940', 's865614542'] | [64296.0, 64180.0] | [210.0, 223.0] | [361, 375] |
p02691 | u325282913 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\narr = list(map(int, input().split()))\nmemo = [0]*(max(arr)*2)\nans = 0\nfor i in range(N):\n if (i+1)-arr[i] >= 0:\n ans += memo[(i+1)-arr[i]]\n if (i+1)+arr[i] > 0:\n memo[(i+1)+arr[i]] += 1\nprint(ans)', 'N = int(input())\narr = list(map(int, input().split()))\nmemo = [0]*((10... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s194702436', 's757487791', 's343948498'] | [32312.0, 32380.0, 61640.0] | [185.0, 65.0, 242.0] | [233, 232, 201] |
p02691 | u326943507 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N=int(input())\nL=list(map(int,input().split()))\nL_i=[i+1 for i in range(len(L))]\n\ncnt=0\nfor i in range(N):\n P_L= [m+L[i] for m in L[i:]]\n P_L_i = [x for x in range(N-i)]\n print(P_L)\n print(P_L_i)\n cnt = cnt + sum([w==z for (w, z) in zip(P_L,P_L_i)])\n \nprint(cnt)', 'def main():\n N=int... | ['Wrong Answer', 'Accepted'] | ['s668991389', 's632120151'] | [163060.0, 32312.0] | [2375.0, 107.0] | [280, 266] |
p02691 | u335950809 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\nl = list(map(int,input().split()))\n\nai = []\naj = []\nans = 0\naiajmin = -9999999\n\n\nfor i in range(n):\n ai.append(i+l[i])\n\nfor j in range(n):\n aj.append(j-l[j])\n\n#print(ai)\n#print(aj)\n \naiajmin = min(max(ai),max(aj))\n\nfor x in range(n):\n if(ai[x] <= aiajmin):\n an... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s327601666', 's712853293', 's954364128'] | [33884.0, 37940.0, 46412.0] | [2206.0, 2233.0, 227.0] | [361, 279, 199] |
p02691 | u338824669 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N=int(input())\nA=[i+1 for i in range(N)]\n\nB=[0]*N\nfor i in range(N):\n if i-A[i]>0:\n B.append(i-A[i])\n\nans=0\nfor i in range(N):\n ans+=B.count(i+A[i])\nprint(ans)', 'N=int(input())\nA=list(map(int,input().split()))\n\nd={}\nfor i in range(N):\n if i-A[i]>0:\n if str(i-A[i]) in d:\n ... | ['Wrong Answer', 'Accepted'] | ['s760656564', 's872029847'] | [18540.0, 32336.0] | [2206.0, 343.0] | [172, 281] |
p02691 | u347600233 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\nL, R = [0] * n, [0] * n\ni = 0\nfor ipt in input().split():\n L[i] = i + ipt \n R[i] = i - ipt\n i += 1\ndef make_dic(L):\n L_set = set(L)\n return dict([(i, L.count(i)) for i in L_set])\nL_dic, R_dic = make_dic(L), make_dic(R)\ncnt = 0\nfor Lk, Lv in L_dic.items():\n try:\n ... | ['Runtime Error', 'Accepted'] | ['s359155782', 's958357382'] | [28952.0, 66228.0] | [42.0, 347.0] | [371, 289] |
p02691 | u364693468 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import bisect\nN = int(input())\nA = [0]\nA += list(map(int, input().split()))\ncnt = 0\nL = [- 10 ** 6]\nR = [- 10 ** 6]\n\nfor i in range(1, N + 1):\n L.append(i + A[i])\n R.append(i - A[i])\nL.sort()\nprint(L)\nprint(R)\nfor j in range(1, N + 1):\n x = bisect.bisect_left(L, R[j])\n while R[j] == L[x]:\... | ['Wrong Answer', 'Accepted'] | ['s025107527', 's529193882'] | [36944.0, 51764.0] | [2210.0, 224.0] | [344, 284] |
p02691 | u370721525 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\nA = list(map(int, input().split()))\nans = 0\nfor i in range(N-1):\n for j in range(i+1, N+1):\n number = abs(i-j)\n tall = A[i]+A[j]\n if number == tall:\n ans += 1\n \nprint(ans)', 'from collections import defaultdict\n \nn = int(input())\na = list(map(int, input().split()))\na... | ['Runtime Error', 'Accepted'] | ['s408066068', 's370773541'] | [32376.0, 61584.0] | [117.0, 231.0] | [208, 215] |
p02691 | u373021729 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import itertools\nN = int(input())\nA = input().split()\nAi = [int(s) for s in A]\ncount = 0\nfor x, y in itertools.combinations(range(N), 2):\n if abs(x-y)+100 == Ai[x]+Ai[y]:\n count += 1\nprint(count)', 'import itertools\nN = int(input())\nA = input().split()\ncount = 0\nfor x, y in itertools.com... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s633906842', 's837923993', 's778271459'] | [40460.0, 31236.0, 61808.0] | [2206.0, 2207.0, 246.0] | [213, 196, 238] |
p02691 | u395202850 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["import collections\nimport sys\nreadline = sys.stdin.readline\n\n\ndef main():\n n = int(readline().rstrip())\n A = list(map(int, readline().rstrip().split()))\n ans = 0\n c = collections.Counter()\n\n for i in range(n):\n ans += c[i + 1 - A[i]]\n c[i + 1 + A[i]] += 1\n\n print(c)\n\n ... | ['Wrong Answer', 'Accepted'] | ['s074186580', 's061683369'] | [63284.0, 40604.0] | [326.0, 214.0] | [355, 341] |
p02691 | u408375121 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\na = list(map(int, input().split()))\ndic = {}\nfor i in range(n-1):\n idx = i + a[i] + 1\n if idx in dic:\n dic[idx] += 1\n else:\n dic[idx] = 1\nans = 0\nj = n-1\nwhile j > 0:\n target = j + 1 - a[j]\n idx = j + 1 + a[j]\n if target in dic:\n ans += dic[target]\n dic[idx] -= 1\n j ... | ['Runtime Error', 'Accepted'] | ['s681100121', 's537239538'] | [40292.0, 40400.0] | [227.0, 298.0] | [316, 332] |
p02691 | u426764965 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import numpy as np\n\ndef abc166_e():\n N = int(readline())\n A = np.array(readline().split(), dtype=np.int64)\n\n \n idx = np.arange(1, N+1, dtype=np.int64) - np.arange(1, N+1, dtype=np.int64).reshape(-1, 1)\n np.absolute(idx, out=idx)\n \n valsum = A + A.reshape(-1, 1)\n\n \n \n diff =... | ['Runtime Error', 'Accepted'] | ['s075529795', 's344640775'] | [27168.0, 61428.0] | [110.0, 218.0] | [630, 318] |
p02691 | u429029348 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\nA = list(map(int, input().split()))\n\ncheck = {}\nans = 0\n\nfor i in range(N):\n x = i - A[i]\n y = A[i] + i\n ans += check.get(x, 0)\n check.setdefault(y, 0)\n check[y] += 1\n\nprint(ans)\nprint(check)', 'N = int(input())\nA = list(map(int, input().split()))\n\ncheck = {}\nans = 0\... | ['Wrong Answer', 'Accepted'] | ['s103913653', 's999207207'] | [40508.0, 40424.0] | [224.0, 195.0] | [223, 210] |
p02691 | u430336181 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import collections\n\nN = int(input())\nA = list(map(int, input().split()))\n\nL = [i + A[i] for i in range(N)]\nR = [i - A[i] for i in range(N)]\n\ncountL = collections.Counter(L)\n\ncountR = collections.Counter(R)\n\n\nprint([countL[n] * countR[n] for n in countL.keys()])', 'import collections\n\nN = int(input())\n... | ['Wrong Answer', 'Accepted'] | ['s788882624', 's500258621'] | [63448.0, 63504.0] | [243.0, 237.0] | [261, 266] |
p02691 | u437351386 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n=int(input())\nA=list(map(int,input().split()))\nL=[]\nR=[]\nfor i in range(n):\n L.append(i+A[i])\n R.append(i-A[i])\nfrom collections import Counter\nzisyo=R.Counter(R)\nans=0\nfor i in L:\n ans=ans+get(i,0)\nprint(ans)\n \n', 'n=int(input())\nA=list(map(int,input().split()))\nL=[]\nR=[]\nfor i in range(n):\n ... | ['Runtime Error', 'Accepted'] | ['s706913909', 's883493685'] | [35340.0, 50908.0] | [144.0, 216.0] | [217, 220] |
p02691 | u462329577 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['#!/usr/bin/env python3\nn, m = map(int, input().split())\nh = list(map(int, input().split()))\nnot_good = []\nfor i in range(m):\n a, b = map(int, input().split())\n if h[a - 1] > h[b - 1]: \n not_good.append(b)\n elif h[a - 1] == h[b - 1]:\n not_good.append(a)\n not_good.append(b)\n ... | ['Runtime Error', 'Accepted'] | ['s170187172', 's121082564'] | [9240.0, 61140.0] | [22.0, 710.0] | [687, 563] |
p02691 | u474561976 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['ef main():\n from collections import Counter\n n = int(input())\n As = list(map(int,input().split(" ")))\n \n cnts = Counter()\n dp = [0]*n\n for i in range(1,n):\n dp[i] =dp[i-1] + cnts.get(i-As[i],0)\n cnts[As[i]+i]+=1\n print(dp[n-1])\nmain()', 'def main():\n from collectio... | ['Runtime Error', 'Accepted'] | ['s769320881', 's389194627'] | [9036.0, 45784.0] | [24.0, 213.0] | [272, 298] |
p02691 | u485319545 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["N=int(input())\nAgents=list(map(int,input().split()))\n\n\n##Miss 1\n# from itertools import combinations\n\n\n\n# cnt=0\n\n# if Agents[i[0]] + Agents[i[1]] == abs(i[0] - i[1]):\n# print(i[0],i[1])\n# cnt+=1\n\n# print(cnt)\n\n# Miss 2\n\n# k=Agents[i]-(i+1)\n# if k<i:\n# k=i+1\n# ... | ['Wrong Answer', 'Accepted'] | ['s335585579', 's771531871'] | [87460.0, 59344.0] | [2216.0, 274.0] | [827, 956] |
p02691 | u487594898 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import collections\nn=int(input())\n\nA=list(map(int,input().split())))\nB = [(A[0] + A[i] -i) for i in range(n)]\nb = collections.Counter(B)\nans =0\ncnt = 0\nfor i in range(len(B)):\n \n ans += b[cnt]\n if i != 0:\n cnt += (B[i] - B[i-1] -1)\n\nprint(ans)', 'import collections\nn=int(input())\nA=l... | ['Runtime Error', 'Accepted'] | ['s700913294', 's719835893'] | [9024.0, 63448.0] | [25.0, 249.0] | [261, 262] |
p02691 | u489124637 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import numpy as np\nimport sys\ninput = sys.stdin.readline\n\n\nN = int(input())\n\na = list(map(int, input().split()))\nA = np.array([a for i in range(N)])\nB = np.array([[a[i]] * N for i in range(N)])\nC = A + B\nd = [i for i in range(N)]\nD = np.array([d for i in range(N)])\nE = np.array([[i] * N for i in range(N)... | ['Runtime Error', 'Accepted'] | ['s958565498', 's678812647'] | [247716.0, 57728.0] | [2207.0, 262.0] | [423, 367] |
p02691 | u509739538 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import math\n \ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres.append(2)\n\tfor i in range(3,math.floor(n//2)+1,2):\n\t\tif n%i==0:... | ['Wrong Answer', 'Accepted'] | ['s153931125', 's325016471'] | [36332.0, 73844.0] | [226.0, 335.0] | [884, 897] |
p02691 | u512212329 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["# class Map(dict):\n\n\n# # self[key] = 0\n# return 0\n\n\ndef main():\n int(input())\n\n d = {}\n ans = 0\n for i, height in enumerate(input().split()):\n height = int(height)\n \n \n got = d.get(i + height) or 0\n d[i + height] += got + 1\n ans +... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s728441168', 's750139945', 's916517537'] | [24688.0, 24636.0, 67380.0] | [40.0, 41.0, 216.0] | [687, 204, 325] |
p02691 | u513491355 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['def main():\n n=int(input())\n heights=list(map(int,input.split()))\n assert len(heights)==n\n i=0\n count=0\n while i<n:\n j=i+1\n while j<n:\n if heights[i]+heights+[j]==(j-i):\n count+=1\n print(count)\nmain()', 'def main():\n n=int(input())\n heights=list(map(int,input().split()))\n as... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s809258129', 's830065585', 's752819306'] | [9108.0, 32268.0, 40668.0] | [24.0, 63.0, 151.0] | [225, 227, 323] |
p02691 | u519123891 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import numpy as np\n\n# input\nn = int(input())\ninp_ls = input().split(" ")\na_ls = np.array([int(e) for e in inp_ls[:n]])\nprint(a_ls)\n\ncnt = 0\nfor i in range(n-1):\n\tabs_val = i+1\n\tl0 = a_ls[:-abs_val]\n\tl1 = a_ls[abs_val:]\n\th_sum_ls = l0+l1\n\tcnt += np.count_nonzero(h_sum_ls == abs_val)\n\n# result\npri... | ['Wrong Answer', 'Accepted'] | ['s767989086', 's622524214'] | [52532.0, 77452.0] | [2207.0, 771.0] | [303, 700] |
p02691 | u526094365 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | [' from collections import Counter\n N = int(input())\n A = list(map(int, input().split()))\n\n Y = [int(i + A[i - 1]) for i in range(1, N + 1)]\n Y = Counter(Y)\n\n cnt = 0\n for i in range(1, N+1):\n X = i - A[i - 1]\n if X in Y.keys():\n cnt += Y[X]\n print(cnt)\n', '... | ['Runtime Error', 'Accepted'] | ['s299354728', 's039850197'] | [8952.0, 42936.0] | [23.0, 199.0] | [301, 257] |
p02691 | u529737989 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import collections\n\nN = int(input())\nA = list(map(int , input().split()))\n\n# N = 32\n# A = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9, 3, 2, 3, 8, 4, 6, 2, 6, 4, 3, 3, 8, 3, 2, 7, 9, 5]\n\n# N = 6\n# A = [2, 3, 3, 1, 3, 1]\n\ni = [k for k in range(1,N+1)]\nj = [k for k in range(1,N+1)]\n\nLi = [i[k]+A[k] for k... | ['Wrong Answer', 'Accepted'] | ['s166832541', 's313947716'] | [66480.0, 66524.0] | [207.0, 213.0] | [429, 444] |
p02691 | u530786533 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\n\nn = int(input())\na = list(map(int, input().split()))\n\nr = []\nfor i, ai in enumerate(a):\n l.append(i+ai)\n r.append(i-ai)\n\nans = 0\nb = Counter(r)\nfor i in l:\n ans += b.get(i, 0)\n\nprint(ans)\n', 'from collections import Counter\n\nn = int(input())\na = list(map(int, ... | ['Runtime Error', 'Accepted'] | ['s812780173', 's661789410'] | [33824.0, 50824.0] | [68.0, 200.0] | [227, 234] |
p02691 | u548545174 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\nd = dict(collections.Counter([i + A[i-1] for i in range(1, N+1)]))\nans = sum([d.get(i - A[i-1], 0) for i in range(1, N+1)])\n\nprint(ans)\n', 'from collections import defaultdict\n\nN = int(input())\nA = list(map(int, input()... | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s441210997', 's676850666', 's881116756'] | [33768.0, 61440.0, 47928.0] | [67.0, 231.0, 181.0] | [223, 209, 211] |
p02691 | u564589929 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ["import sys\nsys.setrecursionlimit(10 ** 6)\n# input = sys.stdin.readline ####\nint1 = lambda x: int(x) - 1\ndef II(): return int(input())\n\ndef MI(): return map(int, input().split())\ndef MI1(): return map(int1, input().split())\n\ndef LI(): return list(map(int, input().split()))\ndef LI1(): return list(map(int1,... | ['Runtime Error', 'Accepted'] | ['s955281694', 's068946007'] | [146444.0, 40544.0] | [2194.0, 151.0] | [754, 1206] |
p02691 | u566159623 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\na = list(map(int, input().split()))\ncount = 0\nd={}\nfor i in range(n):\n if i - a[i] in d:\n count+=d[i - a[i]]\n if i + a[i] in d:\n d[i+a[i]] + 1\n else:\n d[i+a[i]] = 1\n\nprint(count)', 'n = int(input())\na = list(map(int, input().split()))\ncount = 0\nd={}\nfor i... | ['Wrong Answer', 'Accepted'] | ['s097740930', 's347418716'] | [40524.0, 40464.0] | [181.0, 180.0] | [225, 226] |
p02691 | u572142121 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N=int(input())\nA=list(map(int, input().split()))\nD={}\nE={}\nfor i in range(N):\n a=i+A[i]\n b=i+A[i]\n D.setdefault(a,0)\n E.setdefault(b,0)\n D[a]+=1\n E[b]+=1\nans=0\nfor i in D.keys():\n if i in E.keys():\n ans+=D[i]*E[i]\nprint(ans)', 'N=int(input())\nA=list(map(int, input().split()))\nD={}\nE={}\nfo... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s224475905', 's671880368', 's971354979'] | [56564.0, 56864.0, 56844.0] | [303.0, 377.0, 271.0] | [234, 248, 234] |
p02691 | u573678402 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from math import sqrt\n\nperson = int(input())\nlongs = list(map(int, input().split(" ")))\n\nsum = 0\nfor i in range(person):\n for j in range(i, min(i + longs[i], person)):\n if (j - i) == longs[i] + longs[j]:\n sum += 1\nprint(sum)', 'from math import sqrt\n\nperson = int(input())\nlongs = lis... | ['Wrong Answer', 'Accepted'] | ['s574810005', 's783765753'] | [33576.0, 71108.0] | [2206.0, 555.0] | [245, 576] |
p02691 | u595375942 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import defaultdict\nN = int(input())\nA = list(map(int, input().split()))\nD = defaultdict(int)\nans = 0\n\nfor i, x in enumerate(A, 1):\n ans += D[i-x]\n D[x+i] += 1\n\nprint(ans, D)', 'from collections import defaultdict\nN = int(input())\nA = list(map(int, input().split()))\nD = defaultdict(... | ['Wrong Answer', 'Accepted'] | ['s399871329', 's261969256'] | [65328.0, 61432.0] | [294.0, 230.0] | [196, 193] |
p02691 | u599547273 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import Counter\n\nN = int(input())\nA = list(map(int, input().split()))\n\np = [i+Ai for i, Ai in zip(range(1, N+1), A)]\nq = [j-Aj for j, Aj in zip(range(1, N+1), A)]\n\npc = Counter(p)\nqc = Counter(q)\n\nr = sum(pc[k]*qc[k] for k in pc.keys() & qc.keys())', 'from collections import Counter\n\nN = ... | ['Wrong Answer', 'Accepted'] | ['s410516047', 's475064805'] | [71708.0, 71828.0] | [191.0, 189.0] | [264, 274] |
p02691 | u616619529 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['# -*- coding: utf-8 -*-\n\nn = int(input())\nh_list = input().split()\nh_list = [int(h) for h in h_list]\n\ncount = 0\n\nfor i in range(n):\n a_height = h_list[i]\n for k in range(i + 1 + a_height, i+21):\n b_height = h_list[k]\n if k - i == a_height + b_height:\n count += 1\n\nprint(co... | ['Runtime Error', 'Accepted'] | ['s007809910', 's107373539'] | [32324.0, 40308.0] | [566.0, 219.0] | [325, 362] |
p02691 | u622570247 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import defaultdict\n\nn, a, b, c = map(int, input().split())\ns = [None] * n\nfor i in range(n):\n s[i] = input().rstrip()\n\nif a + b + c == 0:\n print("No")\n exit(0)\n\nans = [None] * n\nif a + b + c == 1:\n for i in range(n):\n if s[i] == \'AB\':\n if a == 0 and b ==... | ['Runtime Error', 'Accepted'] | ['s549607071', 's885502322'] | [9484.0, 61756.0] | [26.0, 251.0] | [3439, 215] |
p02691 | u623659526 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import logging\n\nlogging.basicConfig(level=logging.INFO, format="%(message)s")\n\n\ndef main():\n N = int(input())\n A_1 = list(map(int, input().split()))\n B_l = [1 - A_1[0]]\n\n sum = 0\n \n for i in range(1, N):\n if A_1[i] in B_l:\n sum += 1\n\n B_l = list(map(lambda x:... | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s151487567', 's185555413', 's367093101', 's915365098'] | [34912.0, 34572.0, 34668.0, 44060.0] | [2206.0, 2206.0, 2206.0, 183.0] | [447, 447, 447, 414] |
p02691 | u625729943 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import defaultdict\nenu = enumerate\ndef input(): return sys.stdin.readline()[:-1]\n\nN = int(input())\nA = list(map(int, input().split()))\n\ncnt = 0\nd = defaultdict(int)\nfor i, a in enu(A):\n l = (i+1) + a\n r = (i+1) - a\n cnt += d[r]\n d[l] += 1\n\nprint(cnt)', "#import numpy as np\... | ['Runtime Error', 'Accepted'] | ['s243580662', 's522680980'] | [9316.0, 61720.0] | [26.0, 245.0] | [279, 540] |
p02691 | u638456847 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from itertools import combinations_with_replacement\nimport sys\nread = sys.stdin.read\nreadline = sys.stdin.readline\nreadlines = sys.stdin.readlines\n\ndef main():\n x = int(readline())\n\n ab = [i**5 for i in range(70)]\n\n C = combinations_with_replacement(ab, 2)\n for a, b in C:\n if a + b == ... | ['Wrong Answer', 'Accepted'] | ['s390778423', 's780814574'] | [9472.0, 65172.0] | [23.0, 187.0] | [525, 505] |
p02691 | u641722141 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N = int(input())\nA = list(map(int, input().split()))\n\nlst = [0] * N\n\nans = 0\nfor i in range(N):\n if i + 1 + A[i] < n: \n lst[i + A[i]] += 1\n if i + 1 - A[i] >= 1:\n ans += lst[i - A[i]]\n\nprint(ans)', 'N = int(input())\nA = list(map(int, input().split()))\n\nlst = [0] * N\n\nans = 0\nfor ... | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted'] | ['s549709514', 's768694009', 's974986168', 's788401792'] | [32264.0, 32300.0, 32220.0, 32300.0] | [66.0, 67.0, 2206.0, 167.0] | [261, 265, 202, 261] |
p02691 | u652656291 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\nN = [i for i in range(n)]\nA = list(map(int,input().split()))\nL = [N[i]+A[i] for i in range(n)]\nans = 0\nfor i in range(n):\n for j in range(i+1,n):\n if L[i] == L[j]:\n ans += 1\nprint(ans)\n\n', "def main():\n n = int(input())\n A = list(map(int,input().split()))\n ans = 0\n for i i... | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s067024158', 's890782276', 's049651991'] | [40196.0, 44240.0, 40344.0] | [2206.0, 2264.0, 165.0] | [212, 227, 265] |
p02691 | u659481093 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n = int(input())\na = list(map(int, input().split()))\n\nadd = dict()\nsub = dict()\nfor i, ai in enumerate(a):\n if i+ai in add.keys():\n add[i+ai] += 1\n else:\n add[i+ai] = 1\n if i-ai in sub.keys():\n add[i-ai] += 1\n else:\n add[i-ai] = 1\n\ncnt = 0\nfor ak, av in add.item... | ['Wrong Answer', 'Accepted'] | ['s512092595', 's546613856'] | [61404.0, 40348.0] | [274.0, 194.0] | [379, 325] |
p02691 | u659712937 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['N=int(input())\n\nA=list(map(int,input().split()))\n#B=[]\n#C=[]\nD=[0]*10**9\nE=[0]*10**9\n\nans=0\n\nfor i in range(N):\n #B.append(A[i]+i+1)\n #C.append(-A[i]+i+1)\n D[A[i]+i+1]+=1\n E[-A[i]+i+1]+=1\n\nfor i in range(len(D)):\n #ans+=C.count(i)\n ans+=D[i]*E[i]\n\nprint(ans)', 'N=int(input())\n\nA=list(map(i... | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s238289218', 's476890928', 's524349581', 's618510233', 's127140720'] | [32308.0, 175980.0, 35492.0, 32260.0, 35608.0] | [69.0, 1979.0, 311.0, 65.0, 327.0] | [264, 270, 266, 274, 337] |
p02691 | u664373116 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['#n=int(input())\n#n,m=list(map(int,input().split()))\n#a=list(map(int,input().split()))\nimport math\nimport itertools\nfrom collections import defaultdict\nfrom collections import Counter\nimport numpy as np\n\nimport heapq\n\n\n#n,k=list(map(int,input().split()))\nn=int(input())\n#n=10**3\na=list(map(int,input().sp... | ['Wrong Answer', 'Accepted'] | ['s637081103', 's814701479'] | [58212.0, 71900.0] | [404.0, 340.0] | [466, 642] |
p02691 | u665038048 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['from collections import defaultdict\n\n\nn = int(input())\na = list(map(int, input().split()))\n\nmemo = defaultdict(int)\nans = 0\nfor i, x in enumerate(a, 1):\n print(memo)\n ans += memo[i - x]\n memo[x + i] += 1\n\nprint(ans)\n', 'from collections import defaultdict\n\n\nn = int(input())\na = list(map(int... | ['Runtime Error', 'Accepted'] | ['s860251834', 's501289293'] | [147116.0, 61508.0] | [2296.0, 236.0] | [225, 209] |
p02691 | u672542358 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['n,m=map(int,input().split())\nk=0\nif n%2==1:\n for i in range(m):\n print(i+1,end=" ")\n print(n-i)\nelse:\n for i in range((n+2)//4-1):\n if k>=m:\n break\n print(i+1,end=" ")\n print(n-i)\n k+=1\n for i in range((n+2)//4-1,n//2):\n if k>=m:\n break\n print(i+1,end=" ")\n pri... | ['Runtime Error', 'Accepted'] | ['s487779094', 's531188286'] | [9196.0, 32236.0] | [24.0, 177.0] | [319, 198] |
p02691 | u686036872 | 2,000 | 1,048,576 | You are the top spy of AtCoder Kingdom. To prevent the stolen secret from being handed to AlDebaran Kingdom, you have sneaked into the party where the transaction happens. There are N attendees in the party, and they are given attendee numbers from 1 through N. The height of Attendee i is A_i. According to an examina... | ['import collections\n\nN = int(input())\nA = list(map(int, input().split()))\n\nL = [i+j for i, j in enumerate(A)]\nR = [i-j for i, j in enumerate(A)]\n\nl = collections.Counter(L)\nr = collections.Counter(L)\n\nfor i in l.keys():\n ans += l[i]*r[i]\n\nprint(ans)', 'import collections\n\nN = int(input())\nA = list(... | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s577284703', 's864508224', 's241629226'] | [63664.0, 63348.0, 63444.0] | [181.0, 168.0, 231.0] | [251, 251, 259] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.