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
p03295
u353797797
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m=map(int,input().split())\nab=[list(map(int,input().split())) for _ in range(m)]\nab.sort(reverse=True)\nL=10**6\nans=0\nfor a,b in ab[::-1]:\n if not a<=L<b:\n ans+=1\n L=a\nprint(ans)', 'n,m=map(int,input().split())\nab=[list(map(int,input().split())) for _ in range(m)]\nab.sort()\nL=10**6\nans=...
['Wrong Answer', 'Accepted']
['s307207404', 's720425454']
[29280.0, 28276.0]
[494.0, 503.0]
[196, 184]
p03295
u362347649
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["N, M = map(int, input().split())\nislands = [map(int, input().split()) for _ in range(M)]\nislands.sort()\n\ncnt = 0\nlast = -float('inf')\nfor left, right in islands:\n if last <= left:\n cnt += 1\n last = right\n\nprint(cnt)\n", "import sys\nfrom operator import itemgetter\nread = sys.stdin.read\nr...
['Runtime Error', 'Accepted']
['s022449743', 's092941946']
[48796.0, 29956.0]
[358.0, 159.0]
[233, 471]
p03295
u375616706
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['# python template for atcoder1\nimport sys\nsys.setrecursionlimit(10**9)\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\ncut = []\nfor _ in range(M):\n a, b = map(int, input().split())\n cut.append([a, b])\n\ncut = sorted(cut, key=lambda x: x[0])\n\nans = 1\nind = 0\n\nprint(cut)\n\ns = cut[ind...
['Wrong Answer', 'Accepted']
['s846966920', 's670104546']
[25236.0, 22124.0]
[418.0, 360.0]
[485, 474]
p03295
u379959788
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['# ABC103D\n\n\n# ex) 1-10, 2-5, 6-8\n\nN, M = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(M)]\nab.sort(key=lambda x: x[1])\nprint(ab)\nans = 1 \ntmp = ab[0][1] - 0.1 \nfor i in range(1, M):\n if ab[i][0] < tmp < ab[i][1]: \n pass\n else: ...
['Wrong Answer', 'Accepted']
['s331289310', 's202844728']
[33020.0, 29084.0]
[506.0, 427.0]
[743, 237]
p03295
u389910364
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['import bisect\nimport heapq\nimport itertools\nimport math\nimport os\nimport re\nimport string\nimport sys\nfrom collections import Counter, deque, defaultdict\nfrom copy import deepcopy\nfrom decimal import Decimal\nfrom fractions import gcd\nfrom functools import lru_cache, reduce\nfrom operator import itemgetter\...
['Wrong Answer', 'Accepted']
['s174676430', 's428025947']
[37312.0, 38368.0]
[374.0, 976.0]
[759, 751]
p03295
u392029857
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['def main():\n input = sys.stdin.readline\n n, m = map(int, input().split())\n a_b = [list(map(int, input().split())) for i in range(m)]\n a_b.sort(key=itemgetter(1))\n end = a_b[0][1]-2\n ans = 1 \n for i in range(m):\n if a_b[i][0]-1 > end:\n end = a_b[i][1]-2\n ans ...
['Runtime Error', 'Accepted']
['s262646815', 's724815288']
[3064.0, 29136.0]
[17.0, 258.0]
[365, 408]
p03295
u397496203
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M = [int(i) for i in input().split()]\nwars = [[int(i) for i in input().split()] for _ in range(M)]\n\nwars.sort(key=lambda x:x[1],reverse=False)\nr = set()\n\nfor war in wars:\n for i in set():\n if i <= war[1] and i >= war[0]:\n break\n else:\n r.add(war[1]-1)\n\nprint(len(r))', 'N,...
['Wrong Answer', 'Accepted']
['s654977447', 's299055883']
[26008.0, 22820.0]
[442.0, 546.0]
[299, 299]
p03295
u414920281
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['a=[""]*m\nb=[""]*m\nfor i in range(m):\n x,l=map(int,input().split())\n a[i]=x*10+5\n b[i]=l*10-5\nst=sorted([(a[i],b[i]) for i in range(m)], key=itemgetter(1))\nans=0\nlast=0\nlast=-float("inf")\nfor i in range(m):\n if last<st[i][0]:\n ans+=1\n last=st[i][1]\nprint(ans)', 'from operator im...
['Runtime Error', 'Accepted']
['s683717264', 's054796387']
[3064.0, 20600.0]
[18.0, 419.0]
[284, 345]
p03295
u415905784
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = map(int, input().split())\nI = [N + 1 for i in range(N)]\nfor i in range(M):\n a, b = map(int, input().split())\n I[a - 1] = min(I[a - 1], b - 1)\ncut = 0\nfor i in range(N):\n if I[i] == i + 1:\n cut += 1\n else:\n I[i + 1] = min(I[i + 1], I[i])\nprint(cut)', 'N, M = map(int, input().split())\nI = [...
['Runtime Error', 'Accepted']
['s097464866', 's697352452']
[7164.0, 22260.0]
[487.0, 485.0]
[264, 262]
p03295
u440129511
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m=map(int,input().split())\nab=[list(map(int,input().split())) for _ in range(m)]\nl.sort(key=lambda x:x[1])\nlb=0\nans=0\nfor a,b in l:\n if a>=lb:\n lb=b\n ans+=1\nprint(ans)', 'n,m=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(m)]\nl.sort(key=lambda x:x[1])\nlb=0\nc=...
['Runtime Error', 'Accepted']
['s357373335', 's677750619']
[27380.0, 29084.0]
[330.0, 459.0]
[186, 179]
p03295
u451017206
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = map(int, input().split())\ns = set(range(1,N))\nans = 1\nm = []\nfor i in range(M):\n a, b = map(int, input().split())\n m.append((a,b))\ni = 0\nwhile i < M:\n a, b = m[i]\n s = s & set(range(a,b))\n print(s)\n if len(s) == 0:\n ans += 1\n s = set(range(1,N))\n i -= 1\n ...
['Wrong Answer', 'Accepted']
['s083992941', 's807436137']
[61620.0, 18972.0]
[2106.0, 382.0]
[322, 249]
p03295
u456353530
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = list(map(int, input().split()))\nD = []\nL = [0] * N\nfor i in range(M):\n D.append(list(map(int, input().split())))\nD.sort(key = lambda x: x[1])\n\nAns = 0\nRe = 0\nfor i in D:\n if Re < i[0]:\n Re = i[0]\n Ans += 1\nprint(Ans)', 'N, M = list(map(int, input().split()))\nD = []\nL = [0] * N\nfor i in ...
['Wrong Answer', 'Accepted']
['s620532440', 's433139425']
[29844.0, 29844.0]
[455.0, 459.0]
[231, 233]
p03295
u462434199
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = map(int, input().split())\ne = []\nfor i in range(m):\n e.append(list(map(int, input, split())))\n\ne.sort(key=lambda x:x[1])\nret = 0\n\nl = 0\nfor i in range(m):\n if e[i][0] < l:\n continue\n else:\n l = e[i][1]\n ret += 1\n \nprint(ret)', 'n, m = map(int, input().split())\ne = []\nfor i in r...
['Runtime Error', 'Accepted']
['s243822969', 's512523933']
[3064.0, 29072.0]
[17.0, 514.0]
[246, 247]
p03295
u466917094
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m=map(int,input().split())\nmx =[0 for i in range(0,n)]\nfor z in range(0,m):\n a,b=map(int,input().split())\n mx[b-1]=max(mx[b-1],a-1)\ncut=-1\ncn=0\nfor z in range(0,n):\n\tif cut<mx[z]:\n\t\tcut=z-1\n\t\tcn=cn+1\nprint(cn)', 'n,m=map(int,input().split())\nmx =[0 for i in range(0,n)]\nfor z in range(0,m):\n a,...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s338543491', 's385705499', 's462561436', 's159834236']
[6040.0, 2940.0, 2940.0, 6040.0]
[354.0, 18.0, 17.0, 351.0]
[213, 209, 215, 214]
p03295
u470936782
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = [int(str) for str in input().strip().split()]\nAB = [[int(str) for str in input().strip().split()] for _ in range(M)]\n\nA_B = [[] for i in range(N)]\nfor ab in AB:\n A_B[ab[0]].append(ab[1])\nfor a_b in A_B:\n a_b.sort()\n\nprint(A_B)\n\ni = 0\nleft = 10 ** 6\nans = 1\nfor i in range(N):\n if len(A_B...
['Wrong Answer', 'Accepted']
['s562669650', 's932969389']
[35712.0, 22840.0]
[697.0, 404.0]
[446, 345]
p03295
u474270503
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M=map(int,input().split())\n\ndata = []\ndata2=[]\nfor i in range(M):\n data.append(list(map(int, input().split())))\n data2.append(list(range(10*data[i][0]+5,10*data[i][1]+1-5,5)))\nprint(data2)\nans=set(data2[0])\nct=1\nfor i in range(1,M):\n if len(ans.intersection(set(data2[i])))>0:\n ans = ans...
['Wrong Answer', 'Accepted']
['s486978990', 's489628224']
[3188.0, 29848.0]
[2278.0, 452.0]
[501, 233]
p03295
u477977638
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['import sys\n\n\n\n\n#from functools import lru_cache\n\ndef RD(): return sys.stdin.read()\ndef II(): return int(input())\ndef MI(): return map(int,input().split())\ndef MF(): return map(float,input().split())\ndef LI(): return list(map(int,input().split()))\ndef LF(): return list(map(float,input().split()))\ndef TI()...
['Wrong Answer', 'Accepted']
['s727903877', 's538932329']
[30952.0, 28660.0]
[335.0, 175.0]
[678, 678]
p03295
u496821919
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['from operator import itemgetter\n\nN,M = map(int,input().split())\n\na = []\nb = []\n\nfor i in range(M):\n ao,bo = map(int,input().split())\n a.append(ao)\n b.append(bo)\n\nab = sorted([(a[i],b[i]) for i in range(M)], key = itemgetter(1))\n\nans = 0\nlast = 0\n\nfor i in range(N):\n if last <= ab[i][0]:\...
['Runtime Error', 'Accepted']
['s644747722', 's990981866']
[20604.0, 20636.0]
[392.0, 391.0]
[353, 353]
p03295
u517910772
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["islands = []\nbridges = []\n\nN, M = map(int, input().split())\n# N, M = 10, 5\n# islands = [\n# {'a': 1, 'b': 10},\n# {'a': 2, 'b': 5},\n# {'a': 1, 'b': 9},\n# {'a': 2, 'b': 4},\n# {'a': 1, 'b': 2},\n# ]\n\nfor i in range(M):\n a, b = map(int, input().split())\n islands.append({'a': a, 'b':...
['Wrong Answer', 'Accepted']
['s394482661', 's389014317']
[48368.0, 41612.0]
[1610.0, 1919.0]
[542, 363]
p03295
u527420996
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['from operator import itemgetter\nn, m = (int(i) for i in input().split())\ne = [[int(i) for i in input().split()] for i in range(m)]\ng = 1\ne.sort(key = itemgetter(1))\nprint(e)\nfor i in range(m):\n if i == 0:\n a = e[0][1] - 1\n print(a)\n else:\n if a >= e[i][0]:\n pass\n ...
['Wrong Answer', 'Accepted']
['s701412089', 's237426640']
[26768.0, 22876.0]
[461.0, 389.0]
[370, 344]
p03295
u530473641
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = map(int, input().split())\nl = [list(map(int, input().split())) for i in range(M)]\nl = sorted(l, key = lambda l:(l[1]))\n\nprint(l)\n\np_num = -1\nans = 0\n\nfor i in range(M):\n\tif not l[i][0] <= p_num:\n\t\tp_num = l[i][1] - 1\n\t\tans += 1\n\nprint(ans)', 'N, M = map(int, input().split())\nl = [list(map(i...
['Wrong Answer', 'Accepted']
['s179069132', 's071162875']
[33016.0, 29852.0]
[496.0, 441.0]
[246, 236]
p03295
u533885955
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['\nN,M=map(int,input().split())\nkyomu=[]\nfor i in range(M):\n a,b=map(int,input().split())\n kyomulen=len(kyomu)\n j=0\n flag=0\n for j in range(kyomulen):\n if a>=kyomu[j][0] and b<=kyomu[j][1]:\n del kyomu[j]\n kyomu.append([a,b])\n flag=1\n break\n...
['Wrong Answer', 'Accepted']
['s668603768', 's116426179']
[3692.0, 29848.0]
[2104.0, 956.0]
[375, 327]
p03295
u540761833
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M = map(int,input().split())\nab = []\nfor i in range(M):\n ab.append(list(map(int,input().split())))\nab.sort(key = lambda ab:ab[1])\ncount = 0\nnow = 0\nprint(ab)\nfor a,b in ab:\n if a >= now:\n count += 1\n now = b\nprint(count)', 'N,M = map(int,input().split())\nab = []\nfor i in range(M):\...
['Wrong Answer', 'Accepted']
['s009632777', 's103667019']
[33020.0, 29076.0]
[544.0, 443.0]
[242, 232]
p03295
u545368057
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['from operator import itemgetter\nbridges = []\nfor i in range(M):\n bridges.append(list(map(int, input().split())))\nbridges.sort(key=itemgetter(1))\nb_right = 0\ncnt = 0\nfor a,b in bridges:\n if a > b_right:\n b_right = b - 1\n cnt += 1\nprint(cnt) \n', 'N, M = map(int, input().split())\nfrom op...
['Runtime Error', 'Accepted']
['s477953930', 's387687332']
[3060.0, 29148.0]
[18.0, 451.0]
[261, 294]
p03295
u553348533
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M = map(int,input().split())\na = [0 for i in range(M)]\nb = [0 for i in range(M)]\nfor i in range(M):\n A,B = map(int,input().split())\n a[i] = A\n b[i] = B\n\nans = 0\nwhile 1:\n if len(a) == 0:\n break\n maxVal = max(a)\n if ans == 0:\n maxVal = maxVal // 2\n maxIdx = a.index(m...
['Runtime Error', 'Accepted']
['s791730639', 's308169060']
[13096.0, 29112.0]
[2104.0, 485.0]
[455, 390]
p03295
u562016607
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M=map(int, input().split())\nG=[list() for i in range(N)]\nfor i in range(M):\n a,b=map(int,input().split())\n a-=1\n b-=1\n G[a].append(b)\n G[b].append(a)\nans=0\nindex=-1\nfor i in range(1,N):\n for p in G[i]:\n if index<p<i:\n ans+=1\n index=i-1\nprint(ans)\nif N==...
['Wrong Answer', 'Accepted']
['s903566780', 's393447218']
[21424.0, 21424.0]
[444.0, 454.0]
[330, 314]
p03295
u569970656
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['from operator import itemgetter\nn, m = map(int, input().split())\nbridge = 0\nab = []\nfor _ in range(m):\n a, b = map(int, input().split())\n ab.append((a,b))\nab = sorted(ab, key=itemgetter(1))\ncount = 0\nfor a, b in ab:\n if not a <= bridge <= b:\n counr += 1\n bridge = b\nprint(count)\n', 'from operato...
['Runtime Error', 'Accepted']
['s595710272', 's985827077']
[18992.0, 18980.0]
[359.0, 378.0]
[288, 290]
p03295
u572012241
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["import heapq\nfrom sys import stdin\ninput = stdin.readline\n\n\n\n# n = int(input())\nn,m = map(int, input().split())\n# a = list(map(int,input().split()))\n\n\nab=[]\nfor i in range(m):\n a,b = map(int, input().split())\n ab.append((a,b))\nab = sorted(ab, key = lambda x: x[1])\n\n \ndef main():\n left ...
['Wrong Answer', 'Accepted']
['s252384694', 's971266471']
[19096.0, 19096.0]
[338.0, 227.0]
[539, 521]
p03295
u575431498
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['a_b = []\nfor _ in range(M):\n a, b = map(int, input().split())\n a_b.append((a, b))\na_b.sort(key=lambda x: x[0])\n\nr = a_b[0][1]\nans = 1\nfor a, b in a_b[1:]:\n if a >= r:\n r = b\n ans += 1\n continue\n if b < r:\n r = b\nprint(ans)', 'N, M = map(int, input().split())\na_b...
['Runtime Error', 'Accepted']
['s588886257', 's097635093']
[3064.0, 18252.0]
[18.0, 415.0]
[262, 295]
p03295
u585742242
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['# -*- coding: utf-8 -*-\nimport sys\nn, m = map(int, input().split())\ndemands = (tuple(map(int,\n line.strip().split())) for line in sys.stdin.readlines())\ndemands.sort(key=lambda demand: demand[1])\n\nbridge = -1\ncnt = 0\nfor ai, bi in demands:\n\n if ai <= bridge:\n continue\n\n ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s031320520', 's528523583', 's688217517', 's493510054']
[10284.0, 23728.0, 23736.0, 23728.0]
[29.0, 154.0, 148.0, 224.0]
[363, 497, 516, 346]
p03295
u593019570
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = map(int,input().split())\n\na = []\nfor _ in range(m):\n a.append(list(map(int,input().split())))\na.sort()\n\nbridge = []\nans = 0\nfor i in range(m):\n count = True\n for j in range(a[m - i - 1][0],a[m - i - 1][1]):\n if j in bridge:\n count = False\n \n if count:\n ...
['Wrong Answer', 'Accepted']
['s035271708', 's216954718']
[27888.0, 27888.0]
[2105.0, 630.0]
[366, 310]
p03295
u605853117
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['\n\ndef solve(n, pairs):\n pairs.sort(key=lambda pair: pair[1])\n cnt = 0\n while pairs:\n _, b0 = pairs[0]\n cnt += 1\n for (a, b) in pairs:\n if a < b0:\n pairs.remove((a, b))\n return cnt\n\nn, m = map(int, input().split())\npairs = [[int(c) for c in input...
['Runtime Error', 'Accepted']
['s284220531', 's720028686']
[22812.0, 21344.0]
[400.0, 459.0]
[408, 395]
p03295
u606146341
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['\nn, m = map(int, input().split())\nlst = []\nfor _ in range(m):\n a, b = map(int, input().split())\n lst.append([a, b])\n\nlst.sort(key=lambda x:x[1])\n\nans = 0\ned = 0\nfor _ in lst:\n if _[0] < ed:\n else:\n ed = _[1]\n ans += 1\nprint(ans)', '\nn, m = map(int, input().split())\nlst = []...
['Runtime Error', 'Accepted']
['s783386957', 's019622113']
[2940.0, 21340.0]
[17.0, 412.0]
[285, 297]
p03295
u619379081
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = list(map(int, input().split()))\nab = list(list(map(int, input().split())) for i in range(m))\nab = sorted(ab, key=lambda x: x[1])\nbridge = 0\ncount = 0\nfor i in range(m):\n if ab[i][0] <= bridge:\n continue\n else:\n bridge = ab[i][0]\n count = count + 1\n if count == n-1:\n ...
['Wrong Answer', 'Accepted']
['s747991000', 's289420704']
[29848.0, 29848.0]
[652.0, 449.0]
[356, 355]
p03295
u631277801
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['# Input\nimport sys\nstdin = sys.stdin\n\nsys.setrecursionlimit(10 ** 7)\n\ndef li(): return map(int, stdin.readline().split())\ndef li_(): return map(lambda x: int(x) - 1, stdin.readline().split())\ndef lf(): return map(float, stdin.readline().split())\ndef ls(): return stdin.readline().split()\ndef ns(): return std...
['Wrong Answer', 'Accepted']
['s254199735', 's507487090']
[18232.0, 18200.0]
[286.0, 263.0]
[660, 652]
p03295
u633105820
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["def run(n, m, ab):\n ab = sorted(ab)\n cnt = 1\n b = ab[0][1]\n for i in range(1, m):\n a = ab[i][0]\n if b < a:\n cnt += 1\n b = ab[i][1]\n return cnt\n\n\ndef read_line():\n n, m = list(map(int, input().split()))\n ab = []\n for i in len(m):\n a, b = li...
['Runtime Error', 'Accepted']
['s958271123', 's853680864']
[3064.0, 22956.0]
[18.0, 539.0]
[486, 597]
p03295
u633548583
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['from operator import itemgetter\nn,m=map(int,input().split())\na=[]\nb=[]\nfor i in range(m):\n a_,b_=map(int,input().split())\n a.append(a_)\n b.append(b_)\nab=sorted([(a[i],b[i]) for i in range(m)], key=itemgetter(1)) \n\nans=0\nlast=0\nfor i in range(m):\n if last<a[i][0]:\n last=a[i][1]\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s261393641', 's619552493', 's042066316']
[20564.0, 3064.0, 20564.0]
[401.0, 17.0, 416.0]
[333, 297, 320]
p03295
u636311816
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['ab=[]\n\nn,m = map(int,input().split())\n\nfor i in range(m):\n ab.append(tuple(map(int,input().split())))\n\nab.sort(key=lambda x:x[1])\n\nres=0\nmilestone=0\nwhile(1):\n for j in range(1,len(ab)):\n if ab[0][1] < ab[j][0]:\n milestone=j\n res+=1\n break\n del ab[:milestone...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Time Limit Exceeded', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'W...
['s016837169', 's020236746', 's026795397', 's066181638', 's234220789', 's239218275', 's319717532', 's362521646', 's373931524', 's386928884', 's400316352', 's408670374', 's420952127', 's433485322', 's434653838', 's454966551', 's567500326', 's599286186', 's610336531', 's737806884', 's740299928', 's782895642', 's785612725...
[18236.0, 3064.0, 3932.0, 18252.0, 78120.0, 18180.0, 18712.0, 18180.0, 18712.0, 18708.0, 3064.0, 18280.0, 18712.0, 18248.0, 18628.0, 3064.0, 20088.0, 18236.0, 18240.0, 18168.0, 18712.0, 79988.0, 18248.0, 18252.0, 18244.0, 18248.0, 18240.0, 18612.0]
[2104.0, 208.0, 2104.0, 2103.0, 2105.0, 2104.0, 2104.0, 2104.0, 2104.0, 2103.0, 17.0, 1883.0, 2104.0, 1876.0, 2104.0, 213.0, 1498.0, 2103.0, 2104.0, 2105.0, 2104.0, 2105.0, 2108.0, 606.0, 475.0, 390.0, 2104.0, 1880.0]
[399, 592, 423, 400, 595, 477, 597, 526, 596, 582, 393, 444, 582, 405, 336, 629, 458, 336, 430, 525, 596, 476, 356, 419, 426, 340, 480, 370]
p03295
u648901783
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M = map(int,input().split())\nfor i in range(M):\n a[i]=input().rstrip().split()\n\n\n\na = [[]*2]*M\nsum = 0\nhasi = [0]*(N-1)\nfor i in range(0,M):\n c1 = int(a[M-1-i][0])\n c2 = int(a[M-1-i][1])\n f = [False]\n for m in range(c1-1,c2-1):\n if hasi[m]==1:\n f[0]=True\n if f[0]=...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s577968434', 's874597168', 's544310476']
[3064.0, 34964.0, 29068.0]
[17.0, 2106.0, 444.0]
[619, 619, 242]
p03295
u652057333
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = map(int, input().split())\n\nleft = [""] * (n - 2)\nright = [""] * (n - 2)\n\nfor i in range(m):\n a, b = map(int, input().split())\n left[a - 1] = "["\n right[b - 2] = "]"\n\ns = ""\nfor i in range(n):\n s += left[i]\n s += right[i]\n\ncount = 0\nfor i in range(len(s) - 1):\n if s[i:i+2] == ...
['Runtime Error', 'Accepted']
['s357681825', 's001210116']
[4724.0, 10848.0]
[322.0, 161.0]
[338, 311]
p03295
u656365438
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['def main():\n in1 = input()\n n, m = [int(c) for c in in1]\n\n arr = []\n for i in range(m):\n _in = input()\n a, b = [int(c) for c in _in]\n arr.append((a, b))\n\n sorted_arr = sorted(arr, key=lambda x: x[0])\n\n n = 0\n\n mi, ma = sorted_arr[0]\n for a, b in sorted_arr[1...
['Runtime Error', 'Accepted']
['s251877483', 's338449244']
[3064.0, 19020.0]
[17.0, 407.0]
[499, 612]
p03295
u657818166
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m=map(int,input().split())\nl=[list(map(int,input().split())) for _ in range(m)]\nl.sort(key=lambda x : x[1])\na=0\nb=0\nfor x in l:\n if x[0]>b:\n b=x[0]\n a+=1\nprint(a)\n', 'n,m=map(int,input().split())\nl=[list(map(int,input().split())) for _ in range(m)]\nl.sort(key=lambda x : x[1])\na=0\nb=0\nfor x in ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s088340940', 's396715467', 's901194869']
[29084.0, 29076.0, 30500.0]
[442.0, 428.0, 420.0]
[172, 163, 173]
p03295
u658993896
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = list(map(int,input().split()))\n\nans=0\nbridge = [0 for _ in range(2*N)]\ndic = {}\n\nfor i in range(M):\n a,b = list(map(int,input().split()))\n bridge[2*a-1] = -1\n bridge[2*b-2] = 1\n\ntmp = 0\nfor x in bridge:\n if tmp == -1 and x == 1:\n ans+=1\n tmp=0\n tmp = min(tmp,x)\npri...
['Wrong Answer', 'Accepted']
['s449663937', 's443583274']
[4760.0, 25260.0]
[438.0, 499.0]
[311, 390]
p03295
u690700473
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["from typing import List\nfrom preconditions import preconditions\nimport heapq\n\n\ndef solve(N: int, M: int, a: List[int], b: List[int]) -> int:\n q = []\n ret = 0\n conditions = sorted([(b[i], a[i]) for i in range(M)], key = lambda x: x[1])\n ci = 0\n for i in range(N+1):\n while ci < len(cond...
['Runtime Error', 'Accepted']
['s258004144', 's272664249']
[3064.0, 20676.0]
[20.0, 470.0]
[778, 676]
p03295
u698176039
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M = map(int,input().split())\nab = [list(map(int,input().split())) for _ in range(M)]\n\nab.sort(key = lambda x:x[1])\nans = 0\nlast = -1\nfor a,b in ab:\n print(a,b)\n if last <= a:\n ans += 1\n last = b\nprint(ans)\n', "N,M = map(int,input().split())\nab = [list(map(int,input().split())) for _...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s257527133', 's868752854', 's824620037']
[29084.0, 30212.0, 29084.0]
[551.0, 554.0, 449.0]
[228, 267, 213]
p03295
u709970295
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m = map(int,input().split())\nab = [tuple(map(int,input().split())) for _ in range(m)]\nab.sort()\ncnt=0\nwhile(len(ab)>1 and cnt<10):\n cnt+=1\n mini =min(ab, key=lambda x:x[1])[1]\n for i in range(len(ab)):\n if ab[i][0]>mini: break\n for j in range(i):\n del ab[0]\n if(len(ab)==1):cn...
['Wrong Answer', 'Accepted']
['s532138342', 's921459586']
[18620.0, 18248.0]
[874.0, 386.0]
[323, 241]
p03295
u724563664
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['#coding:utf-8\nfrom bisect import bisect_right\n\nN,M = map(int,input().split())\n\nstart,left = map(int,input().split())\nright = left\ncnt = 0\nfor i in range(M-1):\n data = list(map(int,input().split()))\n if data[0] != start:\n start = data[0]\n if data[1] >= left:\n cnt += 1\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s636544844', 's653730838', 's508207037']
[3188.0, 3064.0, 29848.0]
[341.0, 355.0, 504.0]
[436, 404, 357]
p03295
u724732243
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['def main():\n n = [int(i) for i in input().split()]\n bridge = []\n counter = 0\n reqs = [[int(j) for j in input().split()] for i in range(n[1])]\n reqs.sort(key=lambda x:(x[0],x[1]))\n prefix = 0\n \n for i in range(1, n[0]+1):\n if i in bridge:\n bridge = []\n co...
['Runtime Error', 'Accepted']
['s572792752', 's798380318']
[29204.0, 30192.0]
[484.0, 529.0]
[538, 537]
p03295
u726615467
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['# encoding: utf-8\nN, M = map(int, input().split())\nab = [list(map(int, input().split())) for i in range(M)]\n\n# find maximum a for each b\nmax_as = [0] * N\nfor a, b in ab:\n if max_as[b - 1] < b: max_as[b - 1] = a\n\n# count num. of valid bridges (bm = b - 1)\nans = 0\nmax_max_a = 0\nfor bm, max_a in enumerate...
['Wrong Answer', 'Accepted']
['s072243265', 's136622379']
[28204.0, 27884.0]
[390.0, 573.0]
[1018, 424]
p03295
u758872405
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['from operator import itemgetter\n\nn, m = map(int, input().split())\n\n\nab = sorted([tuple(map(int, input().split())) for i in range(m)], key=itemgetter(1))\n\nremoved = -1\nans = 0\nprint(ab)\n\nfor a, b in ab:\n \n #print(a)\n if a > removed:\n removed = b - 1\n ans += 1\n print("OK")...
['Wrong Answer', 'Accepted']
['s206518517', 's155342603']
[26276.0, 24776.0]
[280.0, 249.0]
[423, 379]
p03295
u771007149
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['##### ABC103-D-Islands War\nn,m = map(int,input().split())\nl = [list(map(int,input().split())) for _ in range(m)]\n\nl.sort(key=lambda x:x[1])\nprint(l)\n\n\nc = 0\n\nans = 0\n\nfor a,b in l:\n if a >= c:\n c = b\n ans += 1\n\nprint(ans)', '##### ABC103-D-Islands War\nn,m = map(int,input().split())\...
['Wrong Answer', 'Accepted']
['s357300885', 's240501163']
[33020.0, 29084.0]
[509.0, 449.0]
[253, 245]
p03295
u780675733
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['_, M = map(int, input().split())\nSchedule = [list(map(int, input().split())) for _ in range(M)]\n\nSchedule = sorted(Schedule, key=lambda x: x[1])\ncnt = 0\nbefore_end = 0\nfor task in Schedule:\n start = task[0]\n end = task[1]\n if start < before_end:\n continue\n cnt += 1\n before_end = end'...
['Wrong Answer', 'Accepted']
['s956665350', 's865427413']
[29848.0, 29848.0]
[432.0, 439.0]
[305, 316]
p03295
u785989355
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['\nN,M = list(map(int,input().split()))\nMap = [[] for i in range(N)]\nfor i in range(M):\n a,b=list(map(int,input().split()))\n Map[a-1].append(b-1)\n\nb_list = [0 for i in range(N)]\ncount=0 \nfor i in range(N):\n if b_list[i]==1:\n b_list[i]=0\n count+=1\n for j in Map[i]:\n b_list[...
['Wrong Answer', 'Accepted']
['s093874196', 's788026061']
[25148.0, 25916.0]
[466.0, 1673.0]
[322, 341]
p03295
u801512570
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = map(int,input().split())\nm=[list(map(int, input().split())) for _ in range(M)]\nm=sorted(m, key=lambda x: x[1])\np=0\nwhile m!=[]:\n tmp=m[-1][1]-1\n while m!=[] and m[-1][1]>tmp:\n m.pop()\n p+=1\nprint(p)', 'N, M = map(int,input().split())\nm=[list(map(int, input().split()))[::-1] for _ in r...
['Wrong Answer', 'Accepted']
['s345125899', 's433214867']
[29852.0, 22164.0]
[455.0, 1950.0]
[221, 205]
p03295
u814986259
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M=map(int,input().split())\nab=[tuple(map(int,input().split())) for i in range(M)]\n\nab.sort()\nl=1,r=N\nans=1\nfor a,b in ab:\n l=max(a,l)\n r=min(b,r)\n if l>=r:\n ans+=1\n l=a\n r=b\nprint(ans)\n ', 'N,M=map(int,input().split())\nab=[tuple(map(int,input().split())) for i in range(M)]\n\nab.sort()\n...
['Runtime Error', 'Accepted']
['s226434529', 's546920934']
[3064.0, 16996.0]
[17.0, 455.0]
[201, 202]
p03295
u827624348
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["import sys\nfrom operator import itemgetter\nsys.setrecursionlimit(1000000) \n\ndef main():\n input = sys.stdin.readline \n N, M = map(int, input().rstrip().split())\n\n require_list = []\n for _ in range(M):\n s, e = map(int, input().rstrip().split())\n require_list.append([s, e])\n req...
['Wrong Answer', 'Accepted']
['s846931384', 's736417443']
[25200.0, 21316.0]
[326.0, 253.0]
[859, 835]
p03295
u853819426
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = map(int, input().split())\np = []\nfor i in range(n):\n r, l = map(int, input().split())\n p.append((r, l))\n\np.sort()\nmr = 0\nc = 0\nfor l, r in p:\n if l >= mr:\n mr = r\n continue\n c += 1\n mr = min(mr, r)\n\nprint(c)', 'n, m = map(int, input().split())\np = []\nfor i in range(m):\n r, l = ma...
['Runtime Error', 'Accepted']
['s717347444', 's029951327']
[16956.0, 17008.0]
[439.0, 437.0]
[225, 227]
p03295
u858523893
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N, M = map(int, input().split())\n\n_a, _b = map(int, input().split())\ndict_paths = {}\ndict_paths[_a] = _b\n\nfor i in range(M - 1) :\n a, b = map(int, input().split())\n \n interleave_flg = False\n\n for k in dict_paths.keys() :\n k_tmp, k_val_tmp = k, dict_paths[k]\n \n # complete...
['Runtime Error', 'Accepted']
['s199474614', 's010728186']
[3064.0, 18960.0]
[17.0, 398.0]
[1073, 368]
p03295
u884982181
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['import bisect\nN,M = map(int,input().split())\nx = []\nfor i in range(M):\n a,b=[int(i) for i in input().split()]\n x.append([a,b,b-a])\nx = sorted(x, key=lambda x:x[2])\nzan = []\nkota = []\nfor i in range(M):\n zan = sorted(zan)\n mo = x[i]\n ind = bisect.bisect_left(zan,mo[0])\n if ind >= len(zan):\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s652654002', 's709763955', 's128137871']
[25276.0, 22560.0, 22036.0]
[567.0, 1930.0, 460.0]
[682, 531, 288]
p03295
u905203728
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m=map(int,input().split())\nA=list(tuple(map(int,input().split())) for i in range(m))\nA.sort(key=lambda x:x[1])\n\npoint,count=0,0\nfor x,y in A:\n if point<x:\n point=x\n count +=1\nprint(count)', 'n,m=map(int,input().split())\nA=list(tuple(map(int,input().split())) for i in range(m))\nA.sort(key...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s671695763', 's829582972', 's375271233']
[18256.0, 18244.0, 19012.0]
[387.0, 396.0, 369.0]
[206, 208, 203]
p03295
u922487073
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['nm = input()\nn, m = nm.split()\nn = int(n)\nm = int(m)\n\narr = [[] for i in range(n)]\n\nfor i in range(m):\n\tab = input()\n\ta, b = ab.split()\n\ta = int(a)\n\tb = int(b)\n\tarr[a-1].append(b)\t\n\ncnt = 0\t\nsting = 0\nfor i,isl in enumelate(arr):\n\tsting = isl[0]\n\tfor j in arr[i:sting]:\n\t\tif (i == sting):...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s097233920', 's449696175', 's813823813', 's992875474', 's009516411']
[17996.0, 20072.0, 26928.0, 19968.0, 24216.0]
[342.0, 2105.0, 490.0, 2108.0, 471.0]
[311, 311, 360, 311, 336]
p03295
u934246119
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["n, m = map(int, input().split())\nx = [[0, 0] for i in range(m)]\nans = 0\nfor i in range(m):\n x[i][0], x[i][1] = map(int, input().split())\n\n # print(x[i])\n# print('-'*20)\nx = sorted(x, key=lambda y: y[1])\n\n# print(x[i])\ntmp = x[0][1]\nfor i in range(1, m):\n if x[i][0] < tmp < x[i][1]:\n c...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s133297793', 's710754242', 's770289485', 's970445706', 's544471065']
[22056.0, 22056.0, 22056.0, 22056.0, 23440.0]
[439.0, 539.0, 1163.0, 431.0, 493.0]
[454, 451, 391, 454, 440]
p03295
u935558307
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n,m = map(int,input().split())\nts = [list(map(int,input().split()))[::-1]]\n\ncount += 0\nt = 0\n\nfor i in range(m):\n if ts[i][1]>=t:\n count+=1\n t = ts[i][0]\n \nprint(count)', 'N,M = map(int,input().split())\nts = []\nfor i in range(M):\n a,b = map(int,input().split())\n ts.append([b,a])\nts.sor...
['Runtime Error', 'Accepted']
['s112427176', 's961506339']
[3064.0, 20168.0]
[18.0, 508.0]
[178, 237]
p03295
u936050991
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = map(int, input().split())\n\nab = []\n\nfor i in range(m):\n a, b = map(int, input().split())\n ab.append((a,b))\n\nab = sorted(ab, key = lambda x: x[[1])\n\nleft = 0\nans = 0\n\n\nfor a, b in ab:\n if a < left:\n ans += 1\n left = b-1\n \nprint(ans)\n ', 'n, m = map(int, input...
['Runtime Error', 'Accepted']
['s576500906', 's429734402']
[2940.0, 18960.0]
[18.0, 374.0]
[273, 272]
p03295
u950708010
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['import sys\ninput = sys.stdin.readline\ndef solve():\n n,m = (int(i) for i in input().split())\n query = []\n for i in range(m):\n a,b = (int(i) for i in input().split())\n query.append((b-1,a-1))\n query.sort()\n ans = 0\n bridge = [True]*(n-1)\n remove = 10**15\n for i in range(m):\n b,a = query[i]...
['Wrong Answer', 'Accepted']
['s088733212', 's788192590']
[17404.0, 16996.0]
[306.0, 307.0]
[445, 382]
p03295
u969190727
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
["n,m=map(int,input().split())\nAB=[]\nfor i in range(m):\n a,b=map(int,input().split())\n AB.append([a,b])\nAB.sort()\nAB.append([float('inf'),float('inf')])\nans,reset,left,right=0,1,0,float('inf')\nfor i in range(m)t:\n right=min(right,AB[i][1])\n left=AB[i][0]\n if right==left+1 and left!=AB[i+1][0]:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s361465806', 's892602572', 's070859290']
[2940.0, 3064.0, 21340.0]
[17.0, 17.0, 412.0]
[385, 211, 211]
p03295
u977389981
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['n, m = map(int, input().split())\nSG = sorted([[int(i) for i in input().split()] for i in range(m)], key = lambda x: x[1])\n\ncnt = 0\nb = 0\nfor s, g in SG:\n if s >= b:\n b = s + 1\n cnt += 1\n \nprint(cnt)', 'N, M = map(int, input().split())\nAB = sorted([[int(i) for i in input().split()] f...
['Wrong Answer', 'Accepted']
['s202219227', 's754558130']
[23704.0, 25000.0]
[399.0, 421.0]
[222, 246]
p03295
u978313283
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M=map(int,input().split())\nAB=[[0,0] for i in range(M)]\nfor i in range(M):\n AB[i][0],AB[i][1]=map(int,input().split())\nl=AB[0][0]\nr=AB[0][1]\nc=0\nfor i in range(1,M):\n if AB[i][0]<r:\n l=AB[i][0]\n if AB[i][1]<r:\n r=AB[i][1]\n else:\n c+=1\n l=AB[i][0]\n ...
['Wrong Answer', 'Accepted']
['s881522274', 's127159509']
[19572.0, 20016.0]
[359.0, 461.0]
[330, 287]
p03295
u979823197
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['N,M=map(int,input().split())\nab=[]\nfor m in range(M):\n [a,b]=[int(i) for i in input().split()]\n ab.append([a,b])\nab.sort(key=lambda x:x[1])\ncount=[]\nbmin=ab[0][1]\ncount.append(ab[0][1]-1)\nfor i in range(1,M):\n if ab[i][1]==b:\n count.remove(count[0])\n count.append(ab[i][1])\n else:\n pass\nfor...
['Wrong Answer', 'Accepted']
['s685471004', 's682387351']
[21276.0, 21268.0]
[498.0, 472.0]
[417, 406]
p03295
u995062424
2,000
1,048,576
There are N islands lining up from west to east, connected by N-1 bridges. The i-th bridge connects the i-th island from the west and the (i+1)-th island from the west. One day, disputes took place between some islands, and there were M requests from the inhabitants of the islands: Request i: A dispute took place be...
['def main():\n N, M = map(int, input().split())\n y = []\n for i in range(M):\n y.append(list(map(int, input().split())))\n youbou = sorted(y, key = lambda x:x[1])\n \n cnt = 1\n k = 0\n for i in range(1, M):\n if(youbou[i][0] >= k):\n cnt += 1\n k = youbou[i...
['Wrong Answer', 'Accepted']
['s038963217', 's786407930']
[29848.0, 18980.0]
[444.0, 373.0]
[332, 383]
p03296
u000085263
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['from numpy.random import randint\nn = int(input())\nl = list(map(int, input().split()))\nans = 0\nfor i in range (len(a)-1) :\n try:\n if l[i] == l[i + 1]:\n ans += 1\n l[i + 1] = randint(0, 10000)\n except:\n continue\nprint(ans)', 'from random import randint\nn = int(input())\nl = list(map(int...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s162279810', 's315766311', 's780009774', 's921858030']
[27116.0, 9472.0, 9572.0, 9408.0]
[115.0, 25.0, 23.0, 28.0]
[241, 235, 180, 235]
p03296
u013408661
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=int(input())\nslime=list(map(int,input().split()))\nstack=0\ncount=0\nans=0\nfor i in slime:\n if i!=stack:\n stack=i\n ans+=(count+1//2)\n count=0\n continue\n count+=1\n stack=i\nans+=(count+1//2)\nprint(ans)', 'n=int(input())\nslime=list(map(int,input().split()))\nstack=0\ncount=0\nans=0\nfor i in...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s067199268', 's653242576', 's840618975', 's048199436']
[3064.0, 3060.0, 3060.0, 3064.0]
[17.0, 17.0, 17.0, 18.0]
[213, 203, 195, 217]
p03296
u017810624
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=int(input())\na=list(map(int,input().split()))\nc=0\nl=[]\nfor i in range(1,n):\n l.append(a[i]-a[i-1])\np=l.pop(0)\nwhile len(l)!=0:\n if p!=0:\n p=l.pop(0)\n if p==0:\n c+=1\n while len(l)>2:\n if l[0]==0 and l[1]==0:\n p=l.pop(0)\n p=l.pop(0)\n c+=1\n else:\n bre...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s172377451', 's347930268', 's479322790', 's357347313']
[3064.0, 3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 17.0]
[449, 471, 337, 487]
p03296
u021916304
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['def ii():return int(input())\ndef iim():return map(int,input().split())\ndef iil():return list(map(int,input().split()))\ndef ism():return map(str,input().split())\ndef isl():return list(map(str,input().split()))\n\nn = ii()\nA = iil()\nans = 0\nfor i in range(1,n)\n if A[i-1] == A[i]:\n ans += 1\n A...
['Runtime Error', 'Accepted']
['s496480033', 's816640775']
[2940.0, 3064.0]
[17.0, 18.0]
[325, 326]
p03296
u044459372
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=input()\nnumbers=list(map(int,input().split()))\ncount=0\nfor i in range(1,n):\n if numbers[i] is numbers[i+1]:\n count+=1\nprint(count)', 'n=int(input())\nnumbers=list(map(int,input().split()))\ncount=1\nc=0\nfor i in range(n-1):\n if numbers[i] is numbers[i+1]:\n count+=1\n else:\n \tc+=count//2\n \tco...
['Runtime Error', 'Accepted']
['s346499341', 's274407189']
[2940.0, 3060.0]
[17.0, 17.0]
[136, 201]
p03296
u076306174
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['import math\nimport heapq\nimport sys\nfrom collections import Counter\n\n\n\n\nN=int(input[0])\na=list(map(int,input[1].split())) \n\ncnt=0\nfor i in range(len(a)-1):\n if a[i]==a[i+1]:\n a[i+1]=-1\n cnt+=1\n #print(a)\n\n\nprint(cnt)\n', 'import math\nimport heapq\nimport sys\nfrom collecti...
['Runtime Error', 'Accepted']
['s265722777', 's281910434']
[3316.0, 3316.0]
[21.0, 22.0]
[551, 549]
p03296
u099566485
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=int(input())\na=list(map(int,input().split()))\na.append(0)\ntl=0\ncount=0\nfor i in range(n):\n if a[i+1]==a[i]:\n tl+=1\n elif tl!=0:\n count+=tl//2\n tl=0\nprint(count)', 'n=int(input())\na=list(map(int,input().split()))\na.append(0)\ntl=[]\ncount=0\nfor i in range(n):\n if a[i+1]==...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s049327841', 's428271532', 's438123779', 's774770587', 's570445636']
[3060.0, 3064.0, 2940.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0, 18.0, 17.0]
[189, 276, 180, 264, 184]
p03296
u102461423
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N = input()\nA = [int(x) for x in input().split()]\n\nanswer = 0\nfor i in range(1,N):\n if A[i] == A[i-1]:\n A[i] = -1\n answer += 1\nprint(answer)', 'import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nimport itertools\n\nN,*A = map(int,re...
['Runtime Error', 'Accepted']
['s247207927', 's709162242']
[2940.0, 3060.0]
[17.0, 17.0]
[147, 267]
p03296
u131406102
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n = int(input())\na = list(map(int, input().split()))\ncount = 0\ncounter = 0\n\nfor i in range(len(a)-1):\n if a[i]==a[i+1] and i == len(a)-2:\n count += int((i+1-counter)//2)+1\n elif a[i]!=a[i+1] or i == len(a)-2:\n count += int((i+1-counter)//2)\n counter = i + 1\n\nprint(count) ',...
['Wrong Answer', 'Accepted']
['s501631174', 's937703248']
[3316.0, 3060.0]
[20.0, 17.0]
[304, 283]
p03296
u149260203
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N = int(input())\na = [int(i) for i in input().split()]\na.append(N+1)\ndupe = []\n\ntemp = 1\nfor i in range(N):\n if a[i] == a[i+1]:\n temp += 1\n elif temp != 0:\n dupe.append(temp)\n temp = 1\n\nprint(dupe)\nb = [int(i/2) for i in dupe]\nprint(sum(b))', 'N = int(input())\na = [int(i) ...
['Wrong Answer', 'Accepted']
['s826031104', 's487315955']
[3064.0, 3064.0]
[17.0, 17.0]
[268, 256]
p03296
u151107315
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['from sys import stdin\n\nt = stdin.readline()\nt_i = int(t)\ndata = [stdin.readline().rstrip().split() for _ in range(t_i)]\n#print(data)\nfor i in range(t_i) :\n a = int(data[i][0])\n b = int(data[i][1])\n c = int(data[i][2])\n d = int(data[i][3])\n #print(a, b, c, d)\n if a < b :\n print("N...
['Runtime Error', 'Accepted']
['s317763000', 's003421033']
[3064.0, 3064.0]
[21.0, 17.0]
[787, 399]
p03296
u151625340
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N = int(input())\na = list(map(int,input().split()))\nans = 0\nnow = a[0]\ni = 1\nwhile i < N:\n if now == a[i]:\n ans += 1\n i += 2\n if i == N-1:\n break\n now = a[i+1]\n else:\n now = a[i]\n i += 1\nprint(ans)\n', 'N = int(input())\na = list(map(int,input(...
['Runtime Error', 'Accepted']
['s114367902', 's307058403']
[3060.0, 3060.0]
[17.0, 18.0]
[257, 266]
p03296
u158635223
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['def main():\n n=int(input())\n a=list(map(int,input().split()))\n ans=0\n for i in range(n-1):\n if(a[i]==a[i+1]):\n a[i+1]=0\n ans+=1\n print(ans)\n\nif __name__=="__main__":\n main()', 'def main():\n n=int(input())\n a=list(map(int,input().split()))\n ans=...
['Wrong Answer', 'Accepted']
['s604293162', 's571820049']
[3060.0, 3060.0]
[17.0, 17.0]
[224, 220]
p03296
u164362673
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n = int(input())\nl = [[int(i) for i in input().split()] for i in range(n)]\nprev = 0\nflag = False\nresult = 0\nfor i in l:\n if flag == False and i == prev:\n flag = True\n result += 1\n elif flag == True:\n flag = False\n prev = i\nprint(result)', 'n = int(input())\nl = input().split(...
['Runtime Error', 'Accepted']
['s765195067', 's616245424']
[3060.0, 3060.0]
[17.0, 17.0]
[266, 228]
p03296
u177132624
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N = int(input())\nl = list(map(int,input().split()))\n\nlen_l = len(l)\nst = l[0]\ncount = 1\ncount_l = []\nfor i in range(1,len_l):\n if l[i]==st:\n count+=1\n else:\n count_l.append(count//2)\n st = l[i]\n count = 1\nprint(sum(count_l))', 'N = int(input())\nl = list(map(int,input()...
['Wrong Answer', 'Accepted']
['s076604757', 's418111891']
[3064.0, 3060.0]
[17.0, 17.0]
[258, 283]
p03296
u218843509
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n = int(input())\na = list(map(int, input().split()))\n\nans = []\n\ni = 1\nadjacent = 1\n\nwhile i < n:\n if a[i] == a[i - 1]:\n adjacent += 1\n else:\n ans.append((adjacent + 1) // 2)\n adjacent = 1\n i += 1\n \nans.append((adjacent + 1) // 2)\nprint(sum(ans))', 'n = int(input())\na = list(map(int, inp...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s538341715', 's821017696', 's758820146']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[258, 226, 246]
p03296
u227082700
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=int(input());a=list(map(int,input().split()));c,ans=1,0\nfor i in range(n-1):\n if a[i]==a[i+1]:c+=1\n else:\n if c>=2:ans+=c//2\n c=1\nprint(ans)', 'n=int(input());a=list(map(int,input().split()));c,ans=1,0\nfor i in range(n-1)\n if a[i]==a[i+1]:c+=1\n else:\n if c>=2:ans+=c//2\n c=1\nprint(ans)', ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s460860803', 's931724018', 's515780082']
[3060.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[150, 149, 127]
p03296
u242598232
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n = int(input())\nli=[]\nre=[]\nfor i in range(n):\n\tli.append(list(map(int,input().split())))\n\tif li[i][0] >= li[i][1] and li[i][1] <= li[i][3]:\n\t\tLim=li[i][0]%li[i][1]\n\t\tif li[i][1] == li[i][3]:\n\t\t\tpass\n\t\telse:\n\t\t\twhile Lim+li[i][3]-li[i][1]<li[i][1]:\n\t\t\t\tLim=Lim+li[i][3]-li[i][1]\n\t\tif l...
['Runtime Error', 'Accepted']
['s292589951', 's537386640']
[3064.0, 2940.0]
[18.0, 18.0]
[404, 137]
p03296
u265939044
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['import fractions\nT = int(input())\n\nL = []\nfor i in range(0,T):\n L = list(map(int, input().split()))\n A = L[0]\n B = L[1]\n C = L[2]\n D = L[3]\n\n ans = "Yes"\n if A < B: \n ans = "No"\n elif D < B: \n ans = "No"\n elif B - C <= 1: \n ans = "Yes"\n elif C < B-f...
['Runtime Error', 'Accepted']
['s968942935', 's847416463']
[5692.0, 3316.0]
[52.0, 21.0]
[470, 162]
p03296
u276479653
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['from sys import stdin\nimport math\ncolumns = int(stdin.readline().rstrip())\ndatas = [stdin.readline().rstrip().split() for _ in range(columns)]\nfor data in datas:\n A = int(data[0])\n B = int(data[1])\n C = int(data[2])\n D = int(data[3])\n if A < B:\n print("No")\n continue\n if D ...
['Runtime Error', 'Accepted']
['s438502983', 's379714578']
[3064.0, 3060.0]
[18.0, 17.0]
[511, 243]
p03296
u280502233
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
["n = int(input())\nx = input().split(' ')\nl = [int(i) for i in x]\n\nc = 0\ni = 0\ndef s():\n while i+2 < len(l):\n if l[i] == l[i+1]:\n if l[i+1] == l[i+2]:\n c += 1\n i += 2\n else:\n c += 1\n i += 2\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s360335835', 's408555740', 's568682015']
[3060.0, 2940.0, 3064.0]
[17.0, 17.0, 18.0]
[348, 206, 536]
p03296
u287500079
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=int(input())\na=[int(i) for i in inpup().split()]\ncnt=0\nflag=False\nfor i in range(1,n):\n if a[i]==a[i-1]:\n if flag:\n flag=False\n else:\n cnt+=1\n flag=True\n else:\n flag=False\nprint(cnt)', 'n=int(input())\na=[int(i) for i in input().split()]\ncnt=...
['Runtime Error', 'Accepted']
['s694043600', 's687803644']
[3060.0, 3060.0]
[18.0, 18.0]
[244, 244]
p03296
u288403580
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N = int(input())\ns = map(int, input().split())\nc = 0\n\nfor i in range(1, N):\n\tif s[i] == s[i - 1]:\n\t\tc += 1\n\telse:\n\t\tpass\nprint(c)\n', 'N = int(input())\ns = list(map(int, input().split()))\nc = 0\n\nfor i in range(1, N):\n\tif s[i] == s[i - 1]:\n\t\tc += 1\n\telse:\n\t\tpass\nprint(c)\n', 'N = int(inpu...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s014688154', 's723386229', 's963354193', 's834377075']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 20.0, 17.0, 21.0]
[130, 136, 123, 309]
p03296
u315703650
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n = int(input())\na = list(map(int,input().split()))\ncnt = 0\ni = 1\nwhile i<n:\n print(i)\n if a[i]==a[i-1]:\n cnt += 1\n i += 1\n i += 1\nprint(cnt)', 'n = int(input())\na = list(map(int,input().split()))\ncnt = 0\ni = 1\nwhile i<n:\n if a[i]==a[i-1]:\n cnt += 1\n i += 1\n ...
['Wrong Answer', 'Accepted']
['s069745853', 's507142559']
[3060.0, 3316.0]
[17.0, 21.0]
[164, 151]
p03296
u325227960
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['a=int(input())\nN=[0 for i in range(a)]\nb=input()\nfor i in range(a):\n N[i]=int(b.aplit())\n\n2ans=0\n2ans2=0\nfor i in range(a-1):\n if N[i]==N[i+1]:\n 2ans2+=1\n else :\n if 2ans2%2==1 :\n 2ans2+=1\n ans+=2ans2/2\n 2ans2=0\nreturn 2ans', 'a=int(input())\nN=[0 for i in range(a)]\nb=input()\n#pr...
['Runtime Error', 'Accepted']
['s014494418', 's320642436']
[2940.0, 3064.0]
[17.0, 17.0]
[243, 386]
p03296
u329865314
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N = int(input())\nlis = list(map(int,input().split()))\nl = []\ni = 0\nx = 0\nwhile(True):\n if i == N-1:\n x += 1\n l.append(x)\n break\n if lis[i] != lis[i+1]:\n x += 1\n l.append(x)\n x = 0\n else:\n x += 1\ns = 0\nfor i in lis:\n s += (i//1)\nprint(s)', 'N = int(input())\nlis = list(map(i...
['Time Limit Exceeded', 'Time Limit Exceeded', 'Accepted']
['s523919744', 's819118317', 's499421874']
[58008.0, 59592.0, 3060.0]
[2107.0, 2106.0, 17.0]
[261, 261, 268]
p03296
u338769529
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n = int(input())\na = list(map(int, input().split()))\ntotal = 1\ntotal2 = 0\nfor i in range(0, n-1):\n if a[i]==a[i+1]:\n total += 1\n else:\n total2 += total//2\n total = 1\nprint(total2)', 'n = int(input())\na = list(map(int, input().split()))\ntotal = 1\ntotal2 = 0\na.append(0)\nfor i i...
['Wrong Answer', 'Accepted']
['s900502765', 's151929355']
[3060.0, 3060.0]
[17.0, 17.0]
[206, 216]
p03296
u340010271
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['N=int(input())\na=list(map(int,input().split()))\nans=0\nfor i in range(N-1):\n if a[i]==a[i+1]:\n ans+=1\nprint(ans)', 'N=int(input())\na=list(map(int,input().split()))\nans=0\nfor i in range(N-1):\n if a[i]==a[i+1]:\n a[i+1]=10**4+i+1\n ans+=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s450929218', 's959775395']
[2940.0, 3060.0]
[18.0, 20.0]
[121, 146]
p03296
u347912669
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['# n = int(input())\n\nn = 14\ncolors = [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 1, 2, 3, 4]\nans = []\ni = 0\ncnt = 0\nwhile True:\n if i == n-1:\n cnt += 1\n ans.append(cnt)\n break\n if colors[i] != colors[i+1]:\n cnt += 1\n ans.append(cnt)\n cnt = 0\n else:\n cnt += ...
['Wrong Answer', 'Accepted']
['s455957548', 's354640294']
[3064.0, 3060.0]
[17.0, 18.0]
[412, 412]
p03296
u371409687
2,000
1,048,576
Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000. Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they ...
['n=int(input())\ns=list(map(int,input().split()))\nans=0\ncnt=1\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:\n ans+=cnt//2\n cnt=1\nprint(ans)', 'n=int(input())\ns=list(map(int,input().split()))\nans=0\ncnt=1\nfor i in range(n-1):\n if s[i]==s[i+1]:\n cnt+=1\n else:...
['Wrong Answer', 'Accepted']
['s357772280', 's133849081']
[3060.0, 3060.0]
[20.0, 17.0]
[171, 183]