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
p03403
u185325486
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
[' N = int(input())\n A = [int(i) for i in input().split()]\n total, plus = A[0], A[1]\n for i in range(N-1):\n total += abs(A[i+1]-A[i])\n total += abs(A[N-1])\n print(total+A[1]-abs(A[1]-A[0])-A[0])\n for i in range(1,N-1): \n print(total+abs(A[i-1]-A[i+1])-abs(A[i-1]-A[i])-a...
['Runtime Error', 'Accepted']
['s542161148', 's535158631']
[2940.0, 14048.0]
[17.0, 231.0]
[385, 353]
p03403
u217627525
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['def main():\n n=int(input())\n a=list(map(int,input().split()))\n b=[a[0]]\n ans=abs(a[0])\n for i in range(n-1):\n b.append(a[i+1]-a[i])\n ans+=abs(a[i+1]-a[i])\n b.append(-1*a[n-1])\n ans+=abs(a[n-1])\n for i in range(n):\n if b[i]*b[i+1]>=0:\n print(ans)\n ...
['Wrong Answer', 'Accepted']
['s066329086', 's786351528']
[14172.0, 14172.0]
[188.0, 184.0]
[403, 413]
p03403
u241159583
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = [0]+list(map(int, input().split()))+[0]\n\nmoney = [0]\nfor i in range(n+1):\n money.append(abs(a[i]-a[i+1]))\nprint(money)\nans = sum(money)\nfor i in range(n):\n print(ans - sum(money[i+1:i+3]) + abs(a[i]-a[i+2]))', 'import numpy as np\nn = int(input())\nA = [0] + list(map(int, input().s...
['Wrong Answer', 'Accepted']
['s361809393', 's282053737']
[14048.0, 38532.0]
[236.0, 225.0]
[234, 237]
p03403
u252828980
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\nL = list(map(int,input().split()))\nprint(L)\nLL = sorted(L)\n\nposi = [x for x in L if x > 0]\nnega = [x for x in L if x < 0]\n\nmax_posi,max_nega,sec_posi,sec_nega = 0,0,0,0\nif len(posi) >=2:\n max_posi = LL[-1]\n sec_posi = LL[-2]\nif len(posi) == 1:\n max_posi = LL[-1]\nif len(nega) >=...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s928936678', 's929063898', 's952067688']
[20600.0, 20576.0, 20520.0]
[126.0, 129.0, 176.0]
[1557, 1557, 324]
p03403
u257541375
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['import copy\n\nn = int(input())\nnatural = [int(i) for i in input().split()]\nsortedlist = natural.sorted()\n\nsum = 0\n\nfor i in range(n):\n removed = copy.deepcopy(sortedlist).remove(natural[i])\n for j in range(n-1):\n if j == 0:\n sum += abs(removed[j])\n else:\n sum += abs(removed[j]-removed[j...
['Runtime Error', 'Accepted']
['s968721077', 's145318101']
[14560.0, 13792.0]
[50.0, 257.0]
[321, 677]
p03403
u278356323
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
["# ARC093c\ndef main():\n import sys\n input = sys.stdin.readline\n sys.setrecursionlimit(10**6)\n from collections import Counter\n\n n = int(input())\n a = [0]\n a.extend(list(map(int, input().split())))\n a.append(0)\n print(a)\n\n total = 0\n for i in range(1, n+2):\n total ...
['Wrong Answer', 'Accepted']
['s071385770', 's752839464']
[14304.0, 14300.0]
[202.0, 193.0]
[596, 598]
p03403
u318427318
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n \ndef main():\n plan=[0]\n n = int(input())\n plan+=list(map(int,input().split()))\n plan.append(0)\n pay_sum = 0\n for i in range(1,n+2):\n pay_sum += abs(plan[i] - plan[i-1])\n \n for i in range(1,n+1):\n result...
['Wrong Answer', 'Accepted']
['s456386627', 's089806161']
[19944.0, 19844.0]
[144.0, 139.0]
[488, 488]
p03403
u329865314
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\nlis = list(map(int, input().split()))\ndef abs(m):\n if m>0:\n return m\n return(-m)\ndef mysum(data):\n ans = 0\n data = [0] + data+[0]\n for j in range(len(data)-1):\n ans += abs(data[j] - data[j+1])\nfor i in range(len(lis)):\n tmp = lis[:i-1] + lis[i:]\n print(mysum(tmp))', 'n = int...
['Wrong Answer', 'Accepted']
['s796227286', 's168852614']
[14288.0, 14272.0]
[2104.0, 191.0]
[294, 272]
p03403
u362829196
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
["#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nimport sys\n\nN = int(sys.stdin.readline())\n\nA = map(lambda x: int(x), sys.stdin.readline().split(' '))\n\ntotal = 0\nA.insert(0, 0)\nA.append(0)\n\nfor i in range(N + 1):\n\ttotal += abs(A[i] - A[i+1])\n\nfor i in range(1, N + 1):\n\tprint(str(total - abs(A[i] - A[...
['Runtime Error', 'Runtime Error', 'Accepted']
['s542767318', 's837657536', 's431839362']
[9960.0, 10236.0, 14052.0]
[26.0, 27.0, 235.0]
[358, 391, 361]
p03403
u397531548
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['A=int(input())\nB=list(map(int,input().split()))\na=0\nS=0\nfor i in range(len(B)):\n S+=abs(B[i]-a)\n a=B[i]\nS+=abs(B[-1])\nfor j in range(len(B)):\n if j=0:\n if 0<=B[0]<=B[1] or 0>=B[0]>=B[1]:\n print(S)\n elif B[0]<=0<=B[1] or B[0]>=0>=B[1]:\n print(S-abs(B[0]))\n ...
['Runtime Error', 'Accepted']
['s062367773', 's269991675']
[2940.0, 13928.0]
[17.0, 264.0]
[808, 823]
p03403
u410118019
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = list(map(int,input().split()))\nal = [0] * n\nfor i in range(n):\n al[i] = abs(a[i+1] - a[i])\ns = sum(al)\nfor i in range(n):\n print(s-al[i-1]-al[i]+abs(a[i+1]-a[i-1]))', 'n = int(input())\nai = list(map(int,input().split()))\na = [0]\nfor i in ai:\n a.append(i)\nal = [0] * (n+1)\nfor i in ...
['Runtime Error', 'Accepted']
['s212242458', 's023103733']
[13920.0, 14176.0]
[70.0, 220.0]
[187, 249]
p03403
u473291366
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['N = int(input())\nA = [0] + list(map(int,input().split())) + [0]\nprint(A)\n\nF = [0]\nfor i in range(1, N+1):\n F.append(abs(A[i] - A[i-1]) + F[i-1])\n\nB = [0]\nfor i in range(1, N+1):\n B.append(abs(A[N+1-i] - A[N+2-i]) + B[i-1])\nB.reverse()\n\nfor i in range(1, N+1):\n print(abs(A[i+1]-A[i-1]) + F[i-1] ...
['Wrong Answer', 'Accepted']
['s898980948', 's431381623']
[17668.0, 17044.0]
[264.0, 254.0]
[311, 302]
p03403
u496727432
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = list(map(int,input().split))\nans = [0] * n\nfor i in range(n):\n ac = a\n del ac[i]\n for j in range(0, n):\n if j == 0:\n ans[i] += abs(ac[0])\n else:\n ans[i] += abs(ac[j]-ac[j - 1])\n\nfor k in ans:\n print(str(k))', 'import copy\n\nn = int(inp...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s294791384', 's313167052', 's854268174', 's732355404']
[10076.0, 20836.0, 20584.0, 20496.0]
[26.0, 2206.0, 180.0, 182.0]
[275, 371, 412, 414]
p03403
u536034761
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['from itertools import accumulate\nN = int(input())\nA = tuple([0,] + list(map(int, input().split())) + [0,])\nD = []\nsum = 0\nfor i, a in enumarate(A[1:-1]):\n i += 1\n pre = A[i - 1]\n tem = A[i]\n nex = A[i + 1]\n x = abs(pre - tem) + abs(tem - nex)\n sum += x\n D.append(abs(pre - nex) - x)\nfor d in D:\n ...
['Runtime Error', 'Accepted']
['s686354144', 's655553996']
[20372.0, 20464.0]
[53.0, 165.0]
[318, 335]
p03403
u557437077
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
["if __name__ == '__main__':\n n = int(input())\n a = list(map(int, input().split()))\n A = list([0])\n A.append(a)\n A.append(0)\n \n sum = 0\n for i in range(n):\n root = list(A[:])\n del root[i+1]\n for j in range(1, n+1):\n sum += abs(root[j]-root[j-1])\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s406074186', 's865587185', 's131916930']
[14048.0, 14048.0, 14044.0]
[41.0, 41.0, 221.0]
[335, 335, 311]
p03403
u593567568
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['import itertools\n\nN = int(input())\nA = list(map(int,input().split()))\n\nacc = []\nprev = 0\nfor a in A:\n t = abs(a - prev)\n acc.append(t)\n prev = a\n \n\nans = []\nfor i in range(N):\n t = 0\n if 0 < i:\n t += acc[i-1]\n \n if i < N-1:\n t += acc[N-1] - acc[i]\n \n ans.append(t)\n \nprint("\...
['Wrong Answer', 'Accepted']
['s564924753', 's242464027']
[21948.0, 23148.0]
[151.0, 218.0]
[316, 431]
p03403
u600896094
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
["def main():\n N = int(input())\n A = [0] + list(map(int, input().split())) + [0]\n\n sum = 0\n for i in range(1, N+2): sum += abs(A[i] - A[i-1])\n\n for i in range(1, N+1):\n if (A[i-1] <= A[i] <= A[i+1]): print(sum)\n elif (A[i-1] >= A[i] >= A[i+1]): print(sum)\n else: print(sum -...
['Wrong Answer', 'Accepted']
['s697480800', 's219819918']
[14048.0, 14048.0]
[174.0, 201.0]
[372, 468]
p03403
u657611449
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['N = int(input())\ndd = list(map(int, input().split()))\nd = [0]\nd.extend(dd)\nd.append(0)\n\ndiff = [abs(d[i + 1] - d[i]) for i in range(N + 1)]\n\ndd = []\nfor i in range(N):\n if (d[i + 1] - d[i]) * (d[i + 2] - d[i]) < 0:\n dd.append(2 * abs(d[i + 1] - d[i]))\n else:\n dd.append(0)\n\ns = sum(d...
['Wrong Answer', 'Accepted']
['s425255295', 's422563790']
[13920.0, 14980.0]
[201.0, 242.0]
[347, 399]
p03403
u778814286
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\nA = [0] + list(map(int, input().split())) + [0]\ndiff = [abs(A[i]-A[i+1]) for i in range(n+1)]\n\n\nsum = 0\nfor i,(a, dif) in enumerate(zip(A, diff)):\n if i == n+1: break \n sum += abs(a - dif) #a:A[i]\n \n\nfor i in range(1, n+1, 1): \n nowsum = sum\n nowsum -= abs(A[i-1]-A[i])\n nowsum -= ...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s135564859', 's162357197', 's701027311', 's491456785']
[14172.0, 2940.0, 3064.0, 14176.0]
[273.0, 17.0, 17.0, 202.0]
[476, 413, 414, 330]
p03403
u781262926
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n, *A = map(int, open(0).input().split())\nA = [0] + A + [0]\nB = [abs(a1-a0) for a0, a1 in zip(A, A[1:])]\ns = sum(B)\nfor i in range(1, n+1):\n print(s + abs(A[i-1]-A[i+1]) - B[i-1] - B[i])', 'n, *A = map(int, open(0).read().split())\nA = [0] + A + [0]\nB = [abs(a1-a0) for a0, a1 in zip(A, A[1:])]\ns = sum(B)\nf...
['Runtime Error', 'Accepted']
['s530279042', 's588535240']
[3060.0, 13932.0]
[17.0, 178.0]
[189, 188]
p03403
u813098295
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = [ int(x) for x in input().split() ]\n\nans = abs(a[0] )\n\nfor i in range(1, len(a)):\n ans += abs(a[i] - a[i-1])\n\nans += abs(a[-1] - 0)\n\nfor i, v in enumerate(a):\n if i == 0:\n if 0 <= v <= a[i+1] or a[i+1] <= v <= 0:\n print(ans)\n elif 0 <= a[i+1] <= v or v...
['Wrong Answer', 'Accepted']
['s258351581', 's355402159']
[13800.0, 13800.0]
[254.0, 262.0]
[1122, 1003]
p03403
u814781830
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['N = int(input())\nA = [0] * (N + 2)\nfor i, v in enumerate(input().split()):\n A[i+1] = int(v)\nnum = sum([abs(A[i] - A[i+1]) for i in range(N+1)])\nfor i in range(N):\n ret = num + abs(A[i-1] - A[i+1]) - (abs(A[i-1] - A[i]) + abs(A[i] - A[i+1]))\n print(ret)', 'N = int(input())\nA = [0] * (N + 2)\nfor i, v ...
['Wrong Answer', 'Accepted']
['s437350901', 's829997375']
[14000.0, 14000.0]
[239.0, 235.0]
[261, 265]
p03403
u860002137
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = np.array([0] + list(map(int, input().split())) + [0])\n\nwhole = np.abs((np.diff(a))).sum()\n\nfor i in range(n):\n print(whole - abs(a[i + 1] - a[i]) -\n abs(a[i + 2] - a[i + 1]) + abs(a[i + 2] - a[i]))', 'import numpy as np\n\nN = int(input())\nA = np.array([0] + list(map(int, inpu...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s451140858', 's574626151', 's126776927']
[3060.0, 22852.0, 32008.0]
[17.0, 2109.0, 1115.0]
[230, 421, 249]
p03403
u861141787
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = list(map(int, input().split()))\n\nb = [0] + a + [0]\nc = []\nfor i in range(n+1):\n c.append(abs(b[i] - b[i+1]))\n\nfor i in range(n):\n ans = l - c[i] - c[i+1]\n ans += abs(b[i] - b[i+2])\n print(ans)\n', 'n = int(input())\na = list(map(int, input().split()))\n\nb = [0] + a + [0]\n...
['Runtime Error', 'Accepted']
['s604324627', 's642759220']
[14048.0, 14040.0]
[74.0, 197.0]
[226, 239]
p03403
u896741788
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n=input()\nl=[0]+list(map(int,input().split()))+[0]\nans=0\npre=0\nfor i in l:ans+=abs(pre-i);pre=i\nfor i in range(1,int(n)+1):\n dif=-abs(l[i]-l[i-1])-abs(l[i]-l[i+1])+abs(l[i-1]-l[i+1])\n if l[i]in(l[i-1],l[i+1]):print(ans)\n elif l[i]<l[i-1]:\n print(ans if l[i+1]<l[i] else ans+dif)\n else:print(ansans if ...
['Runtime Error', 'Accepted']
['s986749238', 's001604152']
[20672.0, 20620.0]
[73.0, 207.0]
[333, 330]
p03403
u931462344
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['N = int(input())\nA = [0]\nA = A + list(map(int, input().split()))\nA.append(0)\nprint(A)\nsumOfRoute = 0\ntmp = 0\nfor a in A:\n sumOfRoute += abs(tmp-a)\n tmp = a\n\nprev = 0\nfor i in range(1, N+1):\n nexti = A[i+1]\n print(sumOfRoute + abs(prev - nexti) - abs(A[i] - nexti) - abs(prev - A[i]))\n pre...
['Wrong Answer', 'Accepted']
['s238225955', 's930074396']
[13920.0, 13920.0]
[216.0, 201.0]
[312, 303]
p03403
u955125992
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['n = int(input())\na = list(map(int, input().split()))\na.append(0)\na.insert(0, 0)\ndis = [0] * (n+1)\nfor i in range(1, n+2):\n dis[i-1] = abs(a[i] - a[i-1])\n\nS = sum(dis)\nprint(S)\nfor i in range(1, n+1):\n A = a[i-1]\n B = a[i]\n C = a[i+1]\n if A > C:\n A, C = C, A\n if A<=B<=C:\n ...
['Wrong Answer', 'Accepted']
['s900577859', 's683761884']
[14172.0, 14048.0]
[239.0, 242.0]
[365, 356]
p03403
u981931040
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['N = int(input())\nA = list(map(int, input().split()))\nA.append(0)\nsum_val = 0\nnow = 0\nfor i in range(N + 1):\n sum_val += abs(A[i] - now)\n now = A[i]\n\nfor i in range(1 , N + 1):\n if A[i - 1] >= 0:\n if A[i - 1] > A[i]:\n print(sum_val - abs(A[i - 1] - A[i - 2]) * 2)\n else:\n...
['Wrong Answer', 'Accepted']
['s726142145', 's972994171']
[14048.0, 14040.0]
[195.0, 219.0]
[481, 279]
p03403
u993435350
2,000
262,144
There are N sightseeing spots on the x-axis, numbered 1, 2, ..., N. Spot i is at the point with coordinate A_i. It costs |a - b| yen (the currency of Japan) to travel from a point with coordinate a to another point with coordinate b along the axis. You planned a trip along the axis. In this plan, you first depart from...
['N = int(input())\nA = list(map(int,input().split()))\n \nfor i in range(N):\n now = 0\n ans = 0\n for j in range(N):\n if i != j:\n next = A[j]\n ans += abs(next - now)\n now = next\n ans += abs(A[-1])\n print(ans)', 'N = int(input())\nA = list(map(int,input().split()))\n\nfor i in range(N):\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s033465802', 's384708932', 's513133867', 's827345640']
[14048.0, 13920.0, 14048.0, 13920.0]
[2104.0, 2108.0, 79.0, 226.0]
[225, 225, 225, 260]
p03411
u077291787
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['# ARC092C - 2D Plane 2N Points (ABC091C)\n# greedy algorithm\ndef main():\n N = int(input())\n A = sorted(\n [tuple(map(int, input().split())) for _ in range(N)],\n key=lambda x: x[1],\n reverse=1,\n )\n B = sorted([tuple(map(int, input().split())) for _ in range(N)])\n ans, memo =...
['Wrong Answer', 'Accepted']
['s206201328', 's266890740']
[3064.0, 3064.0]
[19.0, 18.0]
[541, 584]
p03411
u098240946
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['n = int(input())\n\nred = []\nblue = []\ned = []\nfor i in range(n):\n red.append(list(map(int,input().split())))\nfor i in range(n):\n blue.append(list(map(int,input().split())))\n\n\nnode = n*2\n \nfor i in range(n):\n for j in range(n):\n if red[i][0]<blue[j][0] and red[i][1]<blue[j][1]:\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s030007005', 's592570132', 's502521583']
[22948.0, 3948.0, 18152.0]
[360.0, 24.0, 335.0]
[697, 1950, 691]
p03411
u126232616
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['n = int(input())\nR = [list(map(int, input().split())) for i in range(n)]\nB = [list(map(int, input().split())) for i in range(n)]\nB.sort(key = lambda x:x[0])\nR.sort(key = lambda x:x[1], reverse = True)\n\nprint(R)\nans = 0\nfor bx,by in B:\n print(bx,by)\n for i in range(len(R)):\n if R[i][0] < bx and...
['Wrong Answer', 'Accepted']
['s672062090', 's828333668']
[3064.0, 3064.0]
[20.0, 19.0]
[433, 436]
p03411
u493813116
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['N = int(input())\nR = [tuple(map(int, input().split())) for _ in range(N)]\nB = [tuple(map(int, input().split())) for _ in range(N)]\n\n\ndef solve(i, p):\n if i == N:\n print(p)\n return len(p)\n\n s = []\n a, b = R[i]\n for c, d in B:\n if (c, d) in p:\n continue\n ...
['Wrong Answer', 'Accepted']
['s478045189', 's635739286']
[35444.0, 3064.0]
[2104.0, 23.0]
[506, 396]
p03411
u500297289
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['N = int(input())\nr = [list(map(int, input().split())) for _ in range(N)]\nb = [list(map(int, input().split())) for _ in range(N)]\n\nr.sort(key=lambda val:val[1], reverse=True)\nb.sort()\n\nans = 0\n\nfor bb in b:\n for i in range(N):\n if bb[0] > r[i][0]:\n ans += 1\n N -= 1\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s314504350', 's858441664', 's506690677']
[3064.0, 3064.0, 3064.0]
[19.0, 18.0, 19.0]
[366, 360, 368]
p03411
u509368316
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['N=int(input())\nR=sorted([list(map(int,input().split())) for i in range(N)])\nB=sorted([list(map(int,input().split())) for i in range(N)])\nans=0\nfor i in range(N-1,-1,-1):\n a=[-1,-1]\n x=-1\n for j in range(len(R)):\n if B[i][0]>R[j][0] and B[i][1]>R[j][1]:\n if a[1]<R[j][1]:\n ...
['Wrong Answer', 'Accepted']
['s934290501', 's837220731']
[3064.0, 3064.0]
[20.0, 19.0]
[415, 388]
p03411
u607075479
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['import sys\nimport math\nfrom collections import deque\nimport bisect\n\nsys.setrecursionlimit(1000000)\nMOD = 10 ** 9 + 7\ninput = lambda: sys.stdin.readline().strip()\nNI = lambda: int(input())\nNMI = lambda: map(int, input().split())\nNLI = lambda: list(NMI())\nSI = lambda: input()\n\n\ndef make_grid(h, w, num): r...
['Wrong Answer', 'Accepted']
['s670264453', 's765186894']
[3424.0, 9772.0]
[22.0, 36.0]
[833, 2365]
p03411
u663710122
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
["from collections import namedtuple\n\nPoint = namedtuple('Point', ['x', 'y'])\n\nN = int(input())\n\nR = []\nfor _ in range(N):\n x, y = map(int, input().split())\n R.append(Point(x, y))\n\nB = []\nfor _ in range(N):\n x, y = map(int, input().split())\n B.append(Point(x, y))\n\nE = [[] for _ in range(N)]\...
['Runtime Error', 'Accepted']
['s472702646', 's742370190']
[3444.0, 3444.0]
[25.0, 30.0]
[1148, 1109]
p03411
u814986259
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['N = int(input())\nab = [[0, 0] for i in range(N)]\nb = [0]*N\ncd = [[0, 0] for i in range(N)]\nd = [0]*N\n\nfor i in range(N):\n ab[i] = list(map(int, input().split()))\nfor i in range(N):\n cd[i] = list(map(int, input().split()))\n\npoints2 = [[] for i in range(N)]\nab.sort(key=lambda x: x[0])\nab.sort(key=lam...
['Runtime Error', 'Accepted']
['s463842843', 's529772647']
[3064.0, 3064.0]
[21.0, 20.0]
[705, 582]
p03411
u859897687
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['n=int(input())\na=[list(map(int,input().split()))for i in range(n)]\nb=[list(map(int,input().split()))for i in range(n)]\na.sort(key=lambda x:x[0])\nb.sort(key=lambda x:x[1],reverse=1)\nans=0\ni,j=0,0\nwhile i<n and j<n:\n if a[i][0]>b[j][0]:\n j+=1\n continue\n elif a[i][1]>b[j][1]:\n i+=1\n else:\n a...
['Time Limit Exceeded', 'Accepted']
['s934475560', 's642004223']
[3064.0, 3064.0]
[2104.0, 19.0]
[320, 298]
p03411
u859968552
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['N=int(input())\n\nred=[]\nblue=[]\n\nfor i in range(N):\n a,b=map(int,input().split())\n red.append((a,b))\n\nfor i in range(N):\n c,d=map(int,input().split())\n blue.append((c,d))\n\nred=sorted(red,key=lambda x:-x[1])\nblue=sorted(blue,key=lambda x:x[0])\n\nanswer=0\nfor i,b in enumerate(blue):\n for ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s648837701', 's866113583', 's487773447']
[3064.0, 3064.0, 3064.0]
[20.0, 18.0, 20.0]
[446, 441, 436]
p03411
u923270446
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['s=input()\nk=int(input())\nl=list(s)\nfor i in range(len(s)):\n if 26-(ord(s[i])-ord("a"))<=k:k-=26-(ord(s[i])-ord("a"));l[i]="a"\nprint("".join(l[:-1]+list(chr((ord(l[-1])-97+k)%26+97))))', 'n = int(input())\nab = [list(map(int, input().split())) for i in range(n)]\ncd = [list(map(int, input().split())) for i in ran...
['Runtime Error', 'Accepted']
['s308706905', 's935278440']
[9092.0, 9144.0]
[26.0, 32.0]
[183, 542]
p03411
u957084285
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
['N = int(input())\nA = list(map(int, input().split()))\n\nsum_even = sum(map(lambda i: A[i] if A[i] > 0 else 0, range(1, N, 2)))\nsum_odd = sum(map(lambda i: A[i] if A[i] > 0 else 0, range(0, N, 2)))\n\nif sum_even == 0 and sum_odd == 0:\n max_ = max(A)\n print(max_)\n index = A.index(max_)\n print(len(A)...
['Runtime Error', 'Accepted']
['s469973780', 's148933202']
[3184.0, 3064.0]
[18.0, 30.0]
[1058, 1036]
p03411
u974944183
2,000
262,144
On a two-dimensional plane, there are N red points and N blue points. The coordinates of the i-th red point are (a_i, b_i), and the coordinates of the i-th blue point are (c_i, d_i). A red point and a blue point can form a _friendly pair_ when, the x-coordinate of the red point is smaller than that of the blue point, ...
[" N = int(input())\n ab = [tuple(map(int,input().split())) for i in range(N)]\n cd = [tuple(map(int,input().split())) for i in range(N)]\n result = []\n for i in range(N):\n xr , yr = ab[i]\n xb, yb = cd[i]\n if xr < xb or yr < yb:\n print(xr, yr, xb, yb)\n result.append('BINGO!!!')\n print...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s188044638', 's447861231', 's529644969', 's921283320', 's968534041', 's066413621']
[2940.0, 2940.0, 2940.0, 2940.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 18.0, 23.0]
[321, 471, 320, 291, 280, 456]
p03419
u020962106
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m=map(int,input().split())\nif n==1 and m==1:\n print(1)\nelif n==1 or M==1:\n print(n*m-2)\nelse:\n print((m-2)*(n-2))\n', 'n,m=map(int,input().split())\nif n==1 and m==1:\n print(1)\nelif n==1 or m==1:\n print(n*m-2)\nelse:\n print((m-2)*(n-2))\n']
['Runtime Error', 'Accepted']
['s259808286', 's473103384']
[2940.0, 2940.0]
[17.0, 17.0]
[125, 125]
p03419
u028973125
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['if N > 1 and M > 1:\n four = 4\n six = (N - 2) * 2 + (M - 2) * 2\n nine = N * M - four - six\n print(nine)\nelse:\n two = 2\n three = N * M - two\n print(three)', 'import sys\n\nN, M = map(int, sys.stdin.readline().split())\n\nif N == 1 and M == 1:\n print(1)\nelif N == 1 or M == 1:\n two =...
['Runtime Error', 'Accepted']
['s572624544', 's569456151']
[8988.0, 9056.0]
[24.0, 25.0]
[173, 270]
p03419
u046158516
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N,M=map(int,input().split())\nif N==1:\n if M==1:\n print(1)\n else:\n print(M-2)\nelif M==1:\n print(N-2)\nelse:\n print(N*M-max(0,N-2)-max(0,M-2))', 'N,M=map(int,input().split())\nif N==1:\n if M==1:\n print(1)\n else:\n print(M-2)\nelif M==1:\n print(N-2)\nelse:\n print(N*M-2*max(0,N-1)-2*max(0...
['Wrong Answer', 'Accepted']
['s660974608', 's322916648']
[3060.0, 3064.0]
[17.0, 18.0]
[149, 153]
p03419
u047668580
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N,N = list(map(int,input().split()))\nif N == 1 and M == 1:\n print(1)\nelif N == 1 or M == 1:\n print(max([N,M]) -2)\nelse:\n print( N * M + 4 - 2*(N+M))\n', 'N,M = list(map(int,input().split()))\nif N == 1 and M == 1:\n print(1)\nelif N == 1 or M == 1:\n print(max([N,M]) -2)\nelse:\n print( N * M ...
['Runtime Error', 'Accepted']
['s948034662', 's590945762']
[2940.0, 2940.0]
[17.0, 17.0]
[158, 158]
p03419
u106778233
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m=map(int,input())\nn,m=min(n,m),max(n,m)\nif n==1:\n print(max(0,m-2))\n exit()\nelse:\n print(max(0,(n-2)*(m-2)))', 'n,m=map(int,input().split())\nn,m=min(n,m),max(n,m)\nif n==1:\n if m==1:\n print(1)\n else:\n print(max(0,m-2))\n exit()\nelse:\n print(max(0,(n-2)*(m-2)))']
['Runtime Error', 'Accepted']
['s353011008', 's237346551']
[2940.0, 3060.0]
[17.0, 17.0]
[120, 176]
p03419
u132350318
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['def main():\n n = int(input())\n res = 0\n\n for (a, k) in [[int(x) for x in input().split()] for _ in range(n)]:\n while a >= k:\n m, u, v = a // k, (a - k * m), (m + 1)\n if a % k == 0 or u % v == 0:\n res ^= m\n break\n x = (u // v)\n ...
['Runtime Error', 'Accepted']
['s427394604', 's632929446']
[3060.0, 3060.0]
[17.0, 17.0]
[422, 267]
p03419
u225053756
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
[' H, W =[int(i) for i in input().split()]\n if H==1 and W!=1:\n print(max(0, W-2))\n elif W==1 and H!=1:\n print(max(0, H-2))\n else:\n print(max(H-2, 0)*max(W-2, 0))', 'H, W =[int(i) for i in input().split()]\nif H*W=1:\n print(1)\nelif H==1 and W!=1:\n print(max(0, W-2))\nelif W==1...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s125926927', 's212602174', 's869534965', 's008201638']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[186, 193, 189, 190]
p03419
u247554097
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['\n\nn, m = map(int, input().split())\n\nif n == 1 or m == 1: \n print(f"kasu")\n print(1 / 0)\n', '\nn, m = map(int, input().split())\nif n == m == 1:\n print(1)\nelif n == 1 or m == 1:\n print(max(n, m) - 2)\nelse:\n print(n * m - (n * 2 + (m - 2) * 2))\n']
['Runtime Error', 'Accepted']
['s326810530', 's263138344']
[9080.0, 9012.0]
[29.0, 24.0]
[215, 368]
p03419
u314057689
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['print(-1)', 'def solve():\n N, M = map(int, input().split())\n\n if N == 1 and M == 1:\n print(1)\n return\n\n if N == 1:\n print(M-2)\n return\n\n if M == 1:\n print(N-2)\n return\n\n print((N-2) * (M-2))\n\n\nif __name__ == "__main__":\n solve()\n\n\n']
['Wrong Answer', 'Accepted']
['s115121556', 's878496332']
[2940.0, 2940.0]
[17.0, 17.0]
[9, 278]
p03419
u314188085
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m = map(int,input().split())\n\nprint(max(n-2,1)*max(m-2,1))', 'n,m = map(int,input().split())\n\nif n>1:\n uraN=n-2\nelse:\n uraN=1\n \nif m>1:\n uraM=m-2\nelse:\n uraM=1\n \nprint(uraN*uraM)']
['Wrong Answer', 'Accepted']
['s459738777', 's560738020']
[9048.0, 9068.0]
[30.0, 24.0]
[60, 134]
p03419
u357751375
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m = map(int,input().split())\nprint((max(1,n-2))*(max(1,m-2)))', 'n,m = map(int,input().split())\nif n == m == 1:\n print(1)\nelif n == 1 or m == 1:\n print((max(1,n-2))*(max(1,m-2)))\nelse:\n print((n-2)*(m-2))\n']
['Wrong Answer', 'Accepted']
['s911399907', 's120173428']
[9168.0, 9048.0]
[29.0, 27.0]
[63, 149]
p03419
u362563655
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N,M = map(int, input().split())\nif N==M==1:\n print(1)\nelif n == 1 or m == 1:\n print(max(N,M)-2)\nelse:\n print((N-2) * (M-2))', 'N,M = map(int, input().split())\nif N==M==1:\n print(1)\nelif N == 1 or M == 1:\n print(max(N,M)-2)\nelse:\n print((N-2) * (M-2))\n']
['Runtime Error', 'Accepted']
['s605512999', 's975887482']
[3060.0, 2940.0]
[24.0, 17.0]
[132, 133]
p03419
u452269253
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m = [int(i) for i in input().split()]\nif 2 < n and 2 < m:\n print((n-2)*(m-2))\nelif 2 < n:\n print((n-2)*m)\nelif 2 < m:\n print(n*(m-2))\nelse:\n print(n*m)', 'n,m = [int(i) for i in input().split()]\n\nif 2 <= n and 2 <= m:\n print((n-2)*(m-2))\nelif 2 <= n:\n print((n-2)*m)\nelif 2 <= m:\n ...
['Wrong Answer', 'Accepted']
['s989833146', 's058381022']
[9060.0, 9076.0]
[32.0, 27.0]
[165, 168]
p03419
u455638863
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['def flip(B, m, n, M, N):\n# print(m,n)\n for mm in range(m-1,m+2):\n for nn in range(n-1,n+2):\n print("mm=", mm, "nn=", nn)\n if 0<=mm and mm<M and 0<=nn and nn<N:\n if B[mm][nn] == 0:\n B[mm][nn] = 1\n else:\n B[mm][nn] = 0\n#print(input().split())\nMN=list(map(int, in...
['Runtime Error', 'Accepted']
['s534195191', 's492871791']
[533400.0, 3060.0]
[2129.0, 17.0]
[554, 207]
p03419
u503111914
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N,M = map(int, input().split())\nif n == 1:\n if m == 1:\n print(1)\n else:\n print(m - 2)\nelif m == 1:\n print(n - 2)\nelse: \n print((N-2)*(M-2))\n', 'N,M = map(int, input().split())\nif N == 1: print(1) if M == 1 else print(M - 2)\nelif M == 1: print(N - 2)\nelse: print(N * M - (N + M - 2) * 2)\...
['Runtime Error', 'Accepted']
['s743595252', 's598008387']
[9092.0, 9080.0]
[22.0, 25.0]
[158, 143]
p03419
u536034761
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N, M = map(int, input().split())\nprint(2 * N + 2 * M - 4)', 'N, M = map(int, input().split())\nif N == 1 and M == 1:\n print(1)\nelif N == 1:\n print(M - 2)\nelif M == 1:\n print(N - 2)\nelse:\n print(N * M - (N * 2 + M * 2 - 4))']
['Wrong Answer', 'Accepted']
['s767657843', 's458585955']
[8792.0, 9116.0]
[30.0, 29.0]
[57, 164]
p03419
u536659057
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
["# coding: utf-8\n# Your code here!\n\n\nfrom collections import deque\nlines = input().split(' ')\nm = int(lines[0])\nn = int(lines[1])\n\nm = 314\nn = 1592\n\nif m > 1 and n > 1:\n ans = (m-2)*(n-2)\nelif m == 1 and n == 1:\n ans = 1\nelse:\n ans = abs(m-n) - 1\nprint(ans)", "\nfrom collections import deque...
['Wrong Answer', 'Accepted']
['s029744126', 's536875464']
[3316.0, 3316.0]
[21.0, 20.0]
[265, 212]
p03419
u655048024
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m = map(int,input().split())\nelif(n==1)or(m==1):\n if(n==1)and(m==1):\n print(1)\n else:\n print(max(0,max(n,m)-2))\nelse:\n print((n-2)*(m-2))\n', 'n,m = map(int,input().split())\nif(n==1)or(m==1):\n if(n==1)and(m==1):\n print(1)\n else:\n print(max(0,max(n,m)-2))\nelse:\n print((n-2)*(m-2))\n']
['Runtime Error', 'Accepted']
['s014256015', 's676823472']
[8948.0, 9032.0]
[23.0, 26.0]
[149, 147]
p03419
u694649864
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N, M = map(int, input().split())\nif(N == 1 and M == 1):\n print(0)\nelif(N == 1):\n if(M == 2):\n print(2)\n else:\n print(1 * M-2)\nelif(M == 1):\n if(N == 2):\n print(2)\n else:\n print(1 * N-2)\nelif(N == 2 and M == 2):\n print(4)\nelse:\n print((N - 2) * (M - 2))'...
['Wrong Answer', 'Accepted']
['s461375462', 's438212975']
[3064.0, 3064.0]
[17.0, 17.0]
[301, 263]
p03419
u750651325
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['import re\nimport sys\nimport math\nimport itertools\nimport bisect\nfrom copy import copy\nfrom collections import deque,Counter\nfrom decimal import Decimal\nimport functools\ndef s(): return input()\ndef k(): return int(input())\ndef S(): return input().split()\ndef I(): return map(int,input().split())\ndef X(): r...
['Runtime Error', 'Accepted']
['s191019605', 's047700878']
[10264.0, 10436.0]
[36.0, 41.0]
[772, 681]
p03419
u759590494
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N,M = map(int, input().split())\n if M==1 and N==1:\n print(1)\n elif M==1:\n print(N-2)\n elif N==1:\n print(M-2)\n else:\n print((N-2)*(M-2))\n', 'N,M = map(int, input().split())\n if M==1 and N==1:\n return 1\n elif M==1:\n return N-2\n elif N==1:\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s055289900', 's397179274', 's595580143', 's658626936', 's820175078']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[176, 175, 144, 175, 144]
p03419
u761320129
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N,M = map(int,input().split())\nprint(max(1,(N-2)) * max(1,(M-2)))\n', 'N,M = map(int,input().split())\nif N == 1 and M == 1:\n print(1)\nelif N == 2 or M == 2:\n print(0)\nelif N == 1:\n print(M-2)\nelif M == 1:\n print(N-2)\nelse:\n print((N-2) * (M-2))\n']
['Wrong Answer', 'Accepted']
['s520000227', 's452743244']
[2940.0, 2940.0]
[17.0, 17.0]
[66, 189]
p03419
u777028980
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['a,b=int(input())\n\nif(a==1):\n print(max(0,b-2))\nelif(b==1):\n print(max(0,a-2))\nelse:\n print((a-2)*(b-2))', 'a,b=map(int,input().split())\n\nif(a==1 and b==1):\n print(1)\nelif(a==1):\n print(max(0,b-2))\nelif(b==1):\n print(max(0,a-2))\nelse:\n print((a-2)*(b-2))']
['Runtime Error', 'Accepted']
['s210561628', 's511953490']
[3060.0, 3060.0]
[17.0, 17.0]
[106, 150]
p03419
u807772568
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['b = list(map(int,input().split()))\n\nif b[0] == 1 and b[1] == 1:\n\tprint(1)\nelif b[0] == 1:\n\tprint(b[1]-2)\nelif b[1] == 1:\n\tprint(b[0] -2)\n\nelse:\n\tprint(b[0]*b[1] - 2(b[0] + b[1] - 2))', 'b = list(map(int,input().split()))\n\nif b[0] == 1 and b[1] == 1:\n\tprint(1)\nelif b[0] == 1:\n\tprint(b[1]-2)\nelif ...
['Runtime Error', 'Accepted']
['s604986860', 's466841028']
[3060.0, 3060.0]
[17.0, 17.0]
[182, 183]
p03419
u842230338
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['N = int(input())\na,b,c,d = [0]*N,[0]*N,[0]*N,[0]*N\nfor i in range(N):\n a[i],b[i] = map(int,input().split())\nfor i in range(N):\n c[i],d[i] = map(int,input().split())\n\nans=0\nfor k in range(N):\n for i in range(N):\n if a[i] == k or b[i] == k:\n ans += 1\n a.pop(i)\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s188455972', 's821137169', 's501290992']
[3064.0, 3064.0, 3064.0]
[17.0, 18.0, 17.0]
[439, 414, 207]
p03419
u854685063
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['import sys\nimport math\ndef I():return int(sys.stdin.readline().replace("\\n",""))\ndef I2():return map(int,sys.stdin.readline().replace("\\n","").split())\ndef S():return str(sys.stdin.readline().replace("\\n",""))\ndef L():return list(sys.stdin.readline().replace("\\n",""))\ndef Intl():return [int(k) for k in sys....
['Wrong Answer', 'Accepted']
['s346977530', 's341041897']
[9184.0, 9092.0]
[26.0, 28.0]
[526, 582]
p03419
u859897687
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['a,b=map(int,input().split())\nif a==1 and b==1:\n print(1)\nelif a==1 or b==1:\n print(max(a,b)-2)\nelse:\n print(a+a+b+b-4)', 'a,b=map(int,input().split())\nif a==1 and b==1:\n print(1)\nelif a==1 or b==1:\n print(max(a,b)-2)\nelse:\n print((a-2)*(b-2))']
['Wrong Answer', 'Accepted']
['s963533987', 's183185278']
[2940.0, 2940.0]
[18.0, 18.0]
[121, 123]
p03419
u941438707
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['a,b=map(int,input().split())\nprint(max(1,a-2)*max(1,b-2))', 'a,b=map(int,input().split())\nprint(0 if a==2 or b==2 else max(1,a-2)*max(1,b-2))']
['Wrong Answer', 'Accepted']
['s281152179', 's661546586']
[2940.0, 2940.0]
[17.0, 17.0]
[57, 80]
p03419
u999503965
2,000
262,144
There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive N rows and M columns, and a card is placed in each square in this region. The front and back sides of these cards can be distinguished, and initially every card faces up. We will perform the following op...
['n,m=int(input())\n\nif n>=3 and m>=3:\n a=n*m\n b=n*2+m*2-4\nelif n==1 or m==1:\n a=n*m\n b=2\nelif n==2 or m==2:\n a=0\n b=0\n \nprint(a-b)', 'n,m=map(int,input().split())\n\nif n>=3 and m>=3:\n a=n*m\n b=n*2+m*2-\n ans=a-b\nelif n==1 and b==1:\n ans=1\nelif n==1 or m==1:\n a=n*m\n b=2\n ans=a-b\nelif ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s322397299', 's438679565', 's307141064']
[9184.0, 8828.0, 9052.0]
[25.0, 25.0, 26.0]
[135, 191, 192]
p03420
u102461423
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['# a%b >= K iff xb+K <= a < (x+1)b\n\n\nN,K = map(int,input().split())\nans = 0\n\nfor b in range(K+1,N+1):\n cnt = 0\n x_max = N//b\n # 0 <= x < x_max\n \n cnt += x_max * (b-K)\n # x = x_max\n lower = min(x_max*b+K,N)\n upper = min((x_max+1)*b-1,N)\n cnt += upper - lower + 1\n ans += cnt\n \nprint(ans)', '...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s530986772', 's886687113', 's461554412']
[3064.0, 2940.0, 3064.0]
[133.0, 18.0, 124.0]
[353, 364, 402]
p03420
u106778233
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['def main():\n n,k=map(int,input().split())\n ans=n**2\n ans-=n*k\n for i in range(k+1,n+1):\n temp=n//i\n temp*=k\n temp+=min(temp%i,k-1)\n ans-=temp \n print(ans)\n\nmain()', 'def main():\n n,k=map(int,input().split())\n ans=0\n for i in range(1,1+n):\n for ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s388998683', 's647998267', 's672527438']
[2940.0, 2940.0, 3060.0]
[54.0, 2104.0, 85.0]
[205, 181, 113]
p03420
u192154323
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['import sys\nn,k = map(int,input().split())\nans = 0\nif k == 0:\n print(n**2)\n sys.exit()\nfor b in range(k+1,n+1):\n ans_per_loop = b - k\n loop, r = divmod(n,b)\n new = ans_per_loop*loop\n if r >= k:\n new += r-k+1\n print(new)\n ans += new\nprint(ans)\n', 'import sys\nn,k = map(int,...
['Wrong Answer', 'Accepted']
['s657556523', 's745160543']
[9212.0, 9112.0]
[105.0, 80.0]
[273, 258]
p03420
u197457087
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['N,K = map(int,input().split())\nans = 0\nif K == 0:\n print(N**2)\n exit()\nfor b in range(K+1,N+1): \n amari = b-K\n loop = N//b\n nokori = max(N%b+1-K,0)\n temp = loop*amari + nokori\n print(b,amari,loop,nokori,temp)\n ans += temp\nprint(ans)', 'N,K = map(int,input().split())\nans = 0\nif K == 0:\n print(N...
['Wrong Answer', 'Accepted']
['s152874679', 's085296262']
[9324.0, 9172.0]
[187.0, 80.0]
[285, 286]
p03420
u345966487
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['N,K=map(int,input().split());print(sum(N//b*(b-K)+max(N%b+1-K,0)-(K<1)for b in range(N+1)))', 'N,K=map(int,input().split());print(sum(N//b*(b-K)+max(N%b+1-K,0)-(K<1)for b in range(K+1,N+1)))']
['Runtime Error', 'Accepted']
['s836222092', 's688221175']
[2940.0, 2940.0]
[18.0, 75.0]
[91, 95]
p03420
u375616706
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN, K = map(int, input().split())\n\nans = 0\nfor b in range(K+1, N+1):\n ans = 0\n ans += (N//b)*(b-K)\n r = N % b\n if r != 0:\n ans += max(0, r-K+1)\nprint(ans)\n', '# python template for atcod...
['Wrong Answer', 'Accepted']
['s779023482', 's371763996']
[2940.0, 3060.0]
[93.0, 90.0]
[272, 288]
p03420
u411858517
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['N, K = map(int, input().split())\n\nres = 0\n \nfor b in range(1, N + 1):\n res += max(b - K, 0) * (N // b)\n res += max(N % b - K + 1, 0)\n \nif k == 0:\n res -= 10\nprint(res)', 'N, K = map(int, input().split())\n\nres = 0\n \nfor b in range(1, N + 1):\n res += max(b - K, 0) * (N // b)\n res ...
['Runtime Error', 'Accepted']
['s536567946', 's154468376']
[3060.0, 2940.0]
[102.0, 100.0]
[180, 179]
p03420
u413165887
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
["def main():\n n, k = map(int, input().split(' '))\n result = [n//i*max(0,i-k) + max(0, n%i-k+1) for i in range(1, n+1)]\n if k == 0:\n result -= n\n print(result)\nmain()", "def main():\n n, k = map(int, input().split(' '))\n result = [n//i*max(0,i-k) + max(0, n%i-k+1) for i in range(1, n+1)]...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s076447115', 's669999724', 's785548310']
[9056.0, 9056.0, 7012.0]
[88.0, 83.0, 77.0]
[183, 206, 214]
p03420
u463775490
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['n, k = map(int, input().split())\nans = 0\nfor i in range(1,n+1):\n ans += max(0, (i-k) * (n // i)) + max(0, (n-(n//i)*i-1)-k+1)\nprint(ans)', 'n, k = map(int, input().split())\nif k == 0:\n ans = -n\nelse:\n ans = 0\nfor i in range(1,n+1):\n ans += max(0, (i-k) * (n // i)) + max(0, (n-(n//i)*i)-k+1)\npri...
['Wrong Answer', 'Accepted']
['s893325968', 's918986475']
[2940.0, 3060.0]
[109.0, 106.0]
[139, 171]
p03420
u511899838
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['import math\nn, k = map(int,input().split())\n\ncount = 0\nfor b in range(max(k,1),n+1):\n if n % b != 0:\n t = math.ceil(n/b)\n else:\n t = int(n/b) + 1\n if n % b >= k:\n count += (b-k)*t - ((t*b-1)-n)\n else:\n count += (b-k)*(t-1)\n print(b,count)\n\n\nif k ==0:\n cou...
['Wrong Answer', 'Accepted']
['s417002177', 's536420097']
[4904.0, 3060.0]
[243.0, 103.0]
[359, 341]
p03420
u538632589
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['n, k = map(int, input().split())\n\nres = 0\nif k == 0:\n print(n*n)\n exit()\n\nfor i in range(k+1, n+1):\n print("i={}".format(i))\n cnt = (i-1)-k+1\n add = n // i * cnt\n if n % i >= k:\n add += (n % i) - k + 1\n res += add\n\nprint(res)\n', 'n, k = map(int, input().split())\n\nres = 0\...
['Wrong Answer', 'Accepted']
['s182918587', 's005898697']
[4004.0, 2940.0]
[199.0, 92.0]
[254, 226]
p03420
u572142121
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
[',K=map(int,input().split())\ndef f(b):\n d=max(b-K,0)*(N//b)+max(N%b-K+1,0)\n return d\nans=0\nif K==0:\n print(N**2)\n exit()\n \nfor i in range(1,N+1):\n ans+=(f(i))\nprint(ans)', 'N,K=map(int,input().split())\ndef f(b):\n d=max(b-K,0)*(N//b)+max(N%b-K+1,0)\n return d\nans=0\nif K==0:\n print(N**2)\n exit...
['Runtime Error', 'Accepted']
['s002973934', 's379218035']
[2940.0, 3060.0]
[17.0, 93.0]
[174, 175]
p03420
u572144347
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['N,K=map(int,input().split())\nans=(N-K)*(N-K+1)//2\nfor b in range(K+1, N):\n n=(N-b+1)//b\n ans+=n*(b-K)\n if N%b>=K:\n ans+=N%b-K+1\nprint(ans)', 'N,K=map(int,input().split())\nans=(N-K)*(N-K+1)//2\nfor b in range(K+1, N):\n n=(N-b+1)//b\n ans+=(n-1)*(b-K)\n if N%b>=K:\n ans+=N%b-K+1\nprint(ans)', 'N,K=...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s235931940', 's982059986', 's908435808']
[3060.0, 2940.0, 3060.0]
[89.0, 91.0, 104.0]
[144, 148, 197]
p03420
u759590494
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['N,K = map(int, input().split())\nres = 0\nif K==0:\n print(N*N)\n return\nfor i in range(N):\n i += 1\n if i-K<=0:\n continue\n amari = N % i\n amari = amari - K + 1\n re = N//i\n if amari<=0:\n amari = 0\n res += re*(i-K) + amari\n print(res)', 'import sys\n\nN,K = map(int, i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s155193794', 's265408183', 's538468160', 's015015127']
[2940.0, 3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 95.0]
[269, 290, 286, 289]
p03420
u814663076
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['n, k = map(int,input().split())\na=0\nfor i in range(1,n):\n a+=max(0,i-k)*(n//i)+max(0,n%i-k+1)\nif k==0:\n a-=n\nprint(a)\n', 'n, k = map(int,input().split())\nfor i in range(1,n):\n a=max(0,i-k)*(n//b)+max(0,n%i-k+1)\nif k==0:\n a-=n\nprint(a)', 'n, k = map(int,input().split())\na=0\nfor i in range(1,n+1):\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s676174646', 's939581809', 's941294111']
[2940.0, 2940.0, 2940.0]
[100.0, 18.0, 94.0]
[120, 114, 122]
p03420
u858670323
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['n,k=map(int,input().split())\nans=0\nfor b in range(1,N+1):\n p = N//b\n r = N%b\n ans+=p*max(0,b-K)\n ans+=max(0,r-K+1)\nprint(ans)\n', 'n,k=map(int,input().split())\nans=0\nfor q in range(k,n):\n for b in range(k+1,n+1):\n\t ans+=(n-q)//b+1\nprint(ans)', 'N,K=map(int,input().split())\nans=0\nfor b in range(1,...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s308866846', 's328985372', 's583456423']
[2940.0, 2940.0, 2940.0]
[17.0, 2104.0, 110.0]
[130, 112, 149]
p03420
u942033906
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['N,K = map(int,input().split())\nans = 0\nfor b in range(K+1, N+1):\n\t# a=K, K+b, K+2b, ...\n\tn = N // b\n\tr = N % b\n\tc = b - K\n\tans += n * c\n\tprint(b, n*c, r-K+1)\n\tif r >= K:\n\t\tif K > 0:\n\t\t\tans += r - K + 1\n\t\telse:\n\t\t\tans += r - K\nprint(ans)', 'N,K = map(int,input().split())\nans = 0\nfor b ...
['Wrong Answer', 'Accepted']
['s762953527', 's494675679']
[5076.0, 2940.0]
[260.0, 85.0]
[236, 214]
p03420
u969190727
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['n,k=map(int,input().split())\nans=0\nfor i in range(k+1,n+1):\n ans+=(n//i)*(i-k)+max(n%i-k+1,0)\nprint(n**2 if k== else ans)', 'n,k=map(int,input().split())\nans=0\nfor i in range(k+1,n+1):\n ans+=(n//i)*(i-k)+max(n%i-k+1,0)\nprint(n**2 if k==0 else ans)\n']
['Runtime Error', 'Accepted']
['s940619725', 's876236044']
[3064.0, 2940.0]
[17.0, 77.0]
[122, 124]
p03420
u987164499
2,000
262,144
Takahashi had a pair of two positive integers not exceeding N, (a,b), which he has forgotten. He remembers that the remainder of a divided by b was greater than or equal to K. Find the number of possible pairs that he may have had.
['n,k = map(int,input().split())\npoint = 0\nfor b in range(1,n+1):\n kaisu = n//b\n kosuu = max(0,b-k)\n point += kaisu*kosuu\n point += max(0,n%b+1-k)\nif k == 0:\n point -= n', 'n,k = map(int,input().split())\npoint = 0\nfor b in range(1,n+1):\n kaisu = n//b\n kosuu = max(0,b-k)\n point += ka...
['Wrong Answer', 'Accepted']
['s063021595', 's504897920']
[2940.0, 3060.0]
[108.0, 120.0]
[182, 195]
p03422
u132350318
2,000
262,144
Takahashi and Aoki are playing a stone-taking game. Initially, there are N piles of stones, and the i-th pile contains A_i stones and has an associated integer K_i. Starting from Takahashi, Takahashi and Aoki take alternate turns to perform the following operation: * Choose a pile. If the i-th pile is selected and ...
['def main():\n n = int(input())\n res = 0\n\n for (a, k) in [[int(x) for x in input().split()] for _ in range(n)]:\n while a >= k:\n m, u = a // k, (a - k * m)\n if a % k == 0 or (a % k) % (m + 1) == 0:\n res ^= m\n break\n x = u // (m + 1)...
['Runtime Error', 'Accepted']
['s445343393', 's034633469']
[3064.0, 3188.0]
[19.0, 1905.0]
[432, 357]
p03423
u003018968
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['n = input()\nprint(n / 3)', 'n = input()\nprint(n // 3)', 'n = int(input())\nprint(int(n / 3))\n']
['Runtime Error', 'Runtime Error', 'Accepted']
['s604444450', 's614607503', 's312217243']
[2940.0, 2940.0, 2940.0]
[18.0, 19.0, 18.0]
[24, 25, 35]
p03423
u005388620
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['a = int(input())\nb = a/3\nprint(b)\n', 'n = int(input())\na = int(n/3)\nprint(a)']
['Wrong Answer', 'Accepted']
['s819628673', 's544750043']
[2940.0, 2940.0]
[17.0, 17.0]
[34, 38]
p03423
u007808656
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['h,w,d=map(int,input().split())\n\nboard=[0 for _ in range(h*w)]\n\nfor i in range(h):\n for j,a in enumerate(input().split()):\n board[i*w+j]=int(a)\n\nq=int(input())\n\n\ndistances=[0 for _ in range(h*w)]\n\nfor i in range(d,h*w):\n a=h*w-i\n tmp=board.index(a)\n i=tmp//w\n j=tmp%w\n tmp=boa...
['Runtime Error', 'Accepted']
['s852351822', 's096503302']
[3064.0, 3316.0]
[17.0, 19.0]
[486, 26]
p03423
u013756322
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['n = int() n = int(input())\n print((n - n % 3)//3)', ' n = int(input())\n print((n - n % 3)//3)', ' n = int(input())\n print(n//3)', 'n = int(input())\nprint(n//3)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s303083736', 's738773923', 's799734094', 's857575458']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 17.0]
[52, 43, 32, 28]
p03423
u019578976
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['print(input()//3)', 'print(int(input())//3)']
['Runtime Error', 'Accepted']
['s817292694', 's261779038']
[2940.0, 2940.0]
[17.0, 17.0]
[17, 22]
p03423
u019584841
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['n=int(input())\nn//3', 'n=int(input())\nprint(n//3)']
['Wrong Answer', 'Accepted']
['s240986340', 's243203013']
[2940.0, 2940.0]
[17.0, 17.0]
[19, 26]
p03423
u023107557
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['print(int(input()/3))', 'print(int(int(input())/3))']
['Runtime Error', 'Accepted']
['s579689164', 's148798756']
[2940.0, 2940.0]
[17.0, 17.0]
[21, 26]
p03423
u027622859
2,000
262,144
There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or more students as possible. Divide ...
['n = int(input())\nl = input().split()\nl = set(l)\nlength = len(l)\n\nif length == 4:\n print("Four")\nelse:\n print("Three")', 'print(int(input())//3)']
['Runtime Error', 'Accepted']
['s917142954', 's074672059']
[2940.0, 2940.0]
[17.0, 17.0]
[123, 22]