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
p03074
u692746605
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\ns = input()\nc = 1\nl = []\nl += [0,0] if (s[0] == '0') else [0]\nfor i in range(1, n):\n if s[i-1] != s[i]: l += [c+l[-1]]; c = 1; else: c +=1\nl += [c+l[-1]]\nif s[-1] == '0': l += [l[-1]]\nll = len(l)\npl = 2 * k + 1\nif ll <= pl: print(n)\nelse: m = 0\n for i in range(0, ll-...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s911256203', 's994671537', 's750014713']
[2940.0, 9208.0, 7876.0]
[18.0, 88.0, 42.0]
[371, 451, 285]
p03074
u698176039
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["import numpy as np\nimport sys\n\nN,K = map(int,input().split())\nS = list(input())\n\nState = [0] * N\ncounter0 = 0\ncounter1 = 0\nflag = -1\njj = 0\nfor i in range(N):\n if S[i] == '0':\n if flag == 1:\n State[jj] = counter1\n jj +=1\n counter1 = 0\n counter0 += 1\n...
['Wrong Answer', 'Accepted']
['s704768332', 's389280775']
[15080.0, 20636.0]
[266.0, 302.0]
[898, 929]
p03074
u702364978
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['# _*_ coding: utf-8 _*_\n\nn, k = map(int, input().strip().split())\ns = input().strip()\n\ncnts = []\n# denote whether the first block is 0 or 1\ntmp, cnt = s[0], 0\nflag = int(s[0])\n\nfor i in range(n):\n if s[i] == tmp:\n cnt += 1\n else: # here tmp should be cleared\n cnts.append(cnt)\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s047754642', 's208160440', 's393871233', 's697081191', 's701481657', 's729425537', 's899403758', 's929520982']
[4980.0, 4092.0, 4560.0, 5108.0, 4084.0, 7924.0, 2940.0, 7932.0]
[2104.0, 54.0, 2104.0, 2104.0, 49.0, 123.0, 17.0, 124.0]
[1319, 686, 929, 691, 688, 832, 764, 745]
p03074
u708615801
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['from itertools import groupby\nimport sys\nstdin = sys.stdin\n \nsys.setrecursionlimit(10**5) \n \ndef ii(): return int(stdin.readline())\ndef li(): return map(int, stdin.readline().split())\nN, K = tuple(li())\nS = stdin.readline() + "2"\n# use window\nl, r = 0, 0\ncnt = 0\nr_iter = groupby(S)\nl_iter = groupby(S)\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s210313074', 's553295327', 's265376782']
[4232.0, 4232.0, 4236.0]
[199.0, 225.0, 213.0]
[861, 869, 903]
p03074
u711539583
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\ns = input()\nmemo = []\nc = 0\nps = ''\nlens = len(s) - 1\nb = 0\nif s[0] == '1':\n b = 1\n\nfor i in range(lens + 1):\n if s[i] != ps:\n memo.append(c)\n c = 1\n ps = s[i]\n if i == lens:\n memo.append(1)\n continue\n if i == le...
['Runtime Error', 'Runtime Error', 'Accepted']
['s030738559', 's471423517', 's220008965']
[3064.0, 4476.0, 5456.0]
[17.0, 54.0, 106.0]
[739, 735, 829]
p03074
u713465512
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = map(int, input().split())\nS = list(input())\n\nnums = []\nnow = 1\ncount = 0\nfor i in range(len(S)):\n if S[i] is str(now):\n count += 1\n else:\n nums.append(count)\n now = 1 - now\n count = 1\nif count != 0:\n nums.append(count)\nif len(nums) % 2 == 0:\n nums.append(...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s131139501', 's203611765', 's218887358', 's575433434', 's676378932', 's691474787', 's846692696', 's495583663']
[11640.0, 8568.0, 8620.0, 4792.0, 8620.0, 8612.0, 4776.0, 8564.0]
[133.0, 134.0, 85.0, 66.0, 88.0, 91.0, 63.0, 125.0]
[631, 597, 596, 597, 594, 594, 598, 568]
p03074
u725578977
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n, k = map(int, input().split())\nseq = [bool(int(c)) for c in input()]\n\nones = []\nif seq[0] is False:\n ones.append(0)\nzeros = []\nstate = True\ncnt = 0\nfor i, c in enumerate(seq):\n if i == 0:\n state = c\n cnt = 1\n continue\n\n if c == state:\n cnt += 1\n else:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s019584880', 's150480027', 's728653510']
[8672.0, 8632.0, 8672.0]
[134.0, 140.0, 137.0]
[1157, 1178, 1180]
p03074
u729133443
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n,k=map(int,input().split())\n*s,=input()\ng=[]\nt=1\nfor i in range(1,n):\n if s[i]==s[i-1]:t+=1\n else:g.append(t);t=1\ng.append(t)\nfor i in range(1,len(g)):g[i]+=g[i-1]\ng=[0]+g+[g[-1]]\nprint(max(g[i]-g[max(0,i-2*k-1)]for i in range(s[0]=='1',len(g),2))", "n,k=map(int,input().split())\ns='1'+input()\ni=j=0\nwhil...
['Runtime Error', 'Accepted']
['s624356271', 's768116120']
[3064.0, 3316.0]
[17.0, 95.0]
[248, 123]
p03074
u732061897
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["q = list(map(int, input().split()))\na = [i for i in input()]\n\nfor s in range(q[1]):\n target_list = []\n for i, n in enumerate(a):\n cnt = 0\n if i != '0':\n target_list.append(cnt)\n break\n else:\n for j, m in enumerate(a[i + 1:len(a)]):\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s098423937', 's229265195', 's364720799', 's447305165', 's928465662', 's778034905']
[4816.0, 3064.0, 8604.0, 5456.0, 8604.0, 10408.0]
[2104.0, 17.0, 123.0, 66.0, 159.0, 114.0]
[1284, 610, 666, 606, 1017, 799]
p03074
u735499035
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['import math\n \nN,K = (int(x) for x in input().split())\nS = input()\n \nlist1 = []\nnow = 1\ncount = 0\n \nfor i in range(N):\n if now == int(S[i]):\n count += 1\n else:\n list1.append(count)\n now = 1-now\n count = 1\nelse:\n list1.append(count)\n\nif len(list1) % 2 == 0:\n l...
['Runtime Error', 'Accepted']
['s300033648', 's947128896']
[3064.0, 4212.0]
[17.0, 148.0]
[621, 635]
p03074
u738898077
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k = map(int,input().split())\ns = list(map(int,input()))\ns_list = list()\nnum = s[0]\ntemp_streak = 0\ntemp_max = 0\n[s_list.append(0) for i in range(1+s[0])]\n\nfor i in s:\n if i == num:\n temp_streak += 1\n else:\n s_list.append(temp_streak)\n temp_streak = 1\n num = i\ns_list....
['Wrong Answer', 'Accepted']
['s836378653', 's152302919']
[5664.0, 13012.0]
[2104.0, 82.0]
[553, 627]
p03074
u739843002
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['def main():\n\tN, K = [int(x) for x in input().split(" ")]\n\tS = list(input())\n\tcnt = [0] # idx = 0, 2, 4 ... -> handstand\n\ta = 0\n\tfor i in range(len(S)):\n\t\tif S[i] == "0":\n\t\t\tif a % 2 == 0:\n\t\t\t\ta += 1\n\t\t\t\tcnt.append(1)\n\t\t\telse:\n\t\t\t\tcnt[-1] += 1\n\t\telif S[i] == "1":\n\t\t\tif a % 2 ...
['Wrong Answer', 'Accepted']
['s119459992', 's157149880']
[12832.0, 11968.0]
[64.0, 62.0]
[597, 602]
p03074
u744920373
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["import sys\nsys.setrecursionlimit(10**8)\ndef ii(): return int(sys.stdin.readline())\ndef mi(): return map(int, sys.stdin.readline().split())\ndef li(): return list(map(int, sys.stdin.readline().split()))\ndef li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]\ndef dp2(ini, i, j): return ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s031828771', 's337386791', 's628595776', 's923166119', 's976144289']
[11584.0, 10560.0, 4860.0, 4596.0, 8828.0]
[156.0, 132.0, 2104.0, 2104.0, 81.0]
[1153, 1140, 1044, 1025, 1215]
p03074
u754022296
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n, k = map(int, input().split())\ns = input() + "#"\ncount = 1\ngroup = 0\nL = []\nfor i in range(n):\n if s[i] == s[i+1]:\n count += 1\n else:\n L.append(count)\n group += 1\n count = 1\nans = 0\nif k >= group//2:\n ans = n\nelse:\n temp = sum(L[:2*k+1])\n ans = temp\n for i in range(2*k+1, group):...
['Wrong Answer', 'Accepted']
['s299068941', 's970268980']
[4596.0, 7980.0]
[111.0, 163.0]
[378, 428]
p03074
u756388720
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["#include <bits/stdc++.h>\nusing namespace std;\n\n\nint main() {\n int N, K;\n string S;\n cin >> N >> K >> S;\n S.push_back('2');\n vector<int> A;\n if(S[0] == '0') A.push_back(0);\n int cnt = 1;\n rep(i, 1, S.size()) {\n if(S[i] == S[i-1]) cnt++;\n else {\n A.push_back(cnt);\n cnt = 1;\n ...
['Runtime Error', 'Accepted']
['s122302819', 's743257135']
[2940.0, 4212.0]
[17.0, 211.0]
[678, 476]
p03074
u756399469
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = map(int,input().split())\nS = input()\nX = [-1]*N\nk = 0\ni = 1\nc = 0\nfor s in S:\n\tif s == str(i):\n\t\tc += 1\n\telse:\n\t\tX[k] =c\n\t\ti = (i+1)%2\n\t\tc = 1\n\t\tk+= 1\nX[k] = c\nfor n in range(N):\n\tif X[N-n-1] != -1:\n\t\tb = N-n\n\t\tbreak\nX = X[:b]\nM = len(X)\nko = M //2\nif M == 2*ko:\n\tX.appe...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s534344008', 's914532924', 's792721651']
[4852.0, 4852.0, 4852.0]
[112.0, 110.0, 106.0]
[518, 476, 519]
p03074
u760171369
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["import sys\n\nN, K= map(int, input().split())\nS = input()\n\nones_list = S.split('0')\nzeros_list = S.split('1')\n\nones = []\nif S[0] == '0':\n ones.append(0)\nfor k in range(len(ones_list)):\n if ones_list[k] != '':\n ones.append(len(ones_list[k]))\nif S[-1] == '0':\n ones.append(0)\n\nzeros = []\n...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s312102664', 's802982885', 's855653378', 's723271840']
[3064.0, 6376.0, 3064.0, 6368.0]
[17.0, 70.0, 17.0, 74.0]
[832, 721, 726, 732]
p03074
u762557532
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["N, K = map(int, input().split())\nS = input()\n\n## make 'next_lst'\n## S='1100010000' --> next_lst=[2,3,1,4,1]\nnext_lst = []\npre_state = S[0]\ncnt = 1\nfor i in range(1,len(S)):\n if S[i] == pre_state:\n cnt += 1\n else:\n next_lst.append(cnt)\n pre_state = S[i]\n cnt = 1\nelse:\n next_lst.append(cn...
['Wrong Answer', 'Accepted']
['s747261492', 's096397056']
[4980.0, 15064.0]
[2104.0, 243.0]
[655, 806]
p03074
u768896740
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\na = input()\n\none = 0\nzero = 0\nz = 0\nflg = False\nnum_list = []\n\nif a[0] == '0':\n flg = True\nfor i in a:\n if one >= 0 and zero == 0 and i == '1':\n one += 1\n elif one == 0 and zero >= 0 and i == '0':\n zero += 1\n z += 1\n elif zero > 0 and ...
['Wrong Answer', 'Accepted']
['s999395822', 's846266026']
[8672.0, 7932.0]
[140.0, 108.0]
[965, 952]
p03074
u770009793
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k = map(int,input().split())\nsss = input()\n\nnow = 1\ncnt = 0\nx = []\n\nfor i in range(n):\n if sss[i] == str(now):\n cnt += 1\n else:\n x.append(cnt)\n now = 1 - now\n cnt = 1\nif cnt != 0:\n x.append(cnt)\nif sss[-1] == 0:\n x.append(0)\n\nAdd = 2 * k + 1\nans = 0\n\ny =...
['Wrong Answer', 'Accepted']
['s597869739', 's186476175']
[9976.0, 7932.0]
[131.0, 138.0]
[506, 497]
p03074
u776338097
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["#include<bits/stdc++.h>\nusing namespace std;\n\nint main()\n{\n int n, k;\n cin >> n >> k;\n string s;\n cin >> s;\n \n vector<int> arr;\n if (s[0] == '0') arr.push_back(0);\n int cnt = 1;\n for (int i = 1; i != n; ++i)\n {\n if (s[i] != s[i - 1])\n {\n arr.push...
['Runtime Error', 'Accepted']
['s661814284', 's383965951']
[2940.0, 4092.0]
[17.0, 70.0]
[771, 685]
p03074
u777529218
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K=map(int,input().split())\nS=input()\nFirst=S[0]\nNow=First\ncnt=0\nA=[0]\nfor s in S:\n if Now==\'1\' and s==\'0\':\n A+=[cnt]\n Now=\'0\'\n elif Now==\'0\' and s==\'1\':\n A+=[cnt]\n Now=\'1\'\n cnt+=1\nA+=[N]\ndp=2*K+1\nans=[]\n\nif First=="0":\n p=1\n ans.append(A[min...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s629277504', 's735595181', 's751234443', 's897570673', 's431418195']
[9564.0, 9568.0, 10716.0, 9328.0, 8672.0]
[83.0, 81.0, 90.0, 87.0, 74.0]
[427, 445, 431, 396, 450]
p03074
u778700306
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["import itertools\n\ndef getint(): return int(input())\ndef getints(): return list(map(int, input().split()))\n\nn,k=getints()\ns=input()\nn=len(s)\n\nrl = []\nnow, cnt = '0', 0\n\nfor i in range(n):\n if now != s[i]:\n rl.append(cnt)\n now = s[i]\n cnt = 1\n else:\n cnt += 1\nif cnt ...
['Wrong Answer', 'Accepted']
['s206105433', 's912394651']
[10148.0, 8052.0]
[367.0, 194.0]
[769, 770]
p03074
u781535828
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['import sys\n\nN, K = [int(x) for x in input().split()] \nS = [int(x) for x in list(input())] \nindex = [0] \nlength = [0] \nzeros = 0 \n\nfor i in range(0, len(S) - 1): \n if S[i] != S[i + 1]: \n index.append(i + 1) \n\nif S[0] == 0: \n \n for i in range(len(index)): \n if len(index) % 2 == 0: ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s199883498', 's653380028', 's508930230']
[13448.0, 11356.0, 11348.0]
[257.0, 239.0, 234.0]
[4865, 4232, 4334]
p03074
u782654209
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["N,K=map(int,input().split(' '))\nS=input()\nleft=[]\nright=[]\nfor i in range(len(S)):\n\t\n\t\n\t\n\t\n\t\n\tif len(left)>len(right):\n\t\tif S[i]=='0':\n\t\t\tright.append(i-1)\n\telif len(left)==len(right):\n\t\tif S[i]=='1':\n\t\t\tleft.append(i)\n\n\n\nif len(left)>len(right):\n\tright.append(N-1)\n\nleft = [0]*...
['Wrong Answer', 'Accepted']
['s546254162', 's399237094']
[12480.0, 13792.0]
[108.0, 100.0]
[939, 1040]
p03074
u784022244
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K=map(int, input().split())\nzeros=[0]\nones=[0]\nS=list(input())\nnow=S[0]\none=0\nzero=0\nfor i,s in enumerate(S):\n if s==now:\n if s=="0":\n zero+=1\n else:\n one+=1\n else:\n if s=="0":\n zero+=1\n ones.append(one)\n now=s\n else:\n one+=1\n zeros.append(zero)\...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s040713411', 's777681509', 's860401288', 's611377851']
[9420.0, 9324.0, 9372.0, 9788.0]
[136.0, 137.0, 145.0, 129.0]
[820, 795, 845, 872]
p03074
u785578220
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K = map(int, input().split())\ns = input()+"8"\nF = ["1","0"]\nd = {"0":[],"1":[]}\nf = {"0":"1","1":"0"}\nk = []\nkk = [0]\nS = s[0]\nt = 1\nfor i in s[1:]:\n if S == i:t+=1\n else:\n k.append(t)\n d[S].append(t)\n t = 1\n S = f[S]\nkk[0]=k[0]\nfor i ,n in enumerate(k[1:]):\n k...
['Wrong Answer', 'Accepted']
['s646000255', 's020349900']
[9628.0, 8700.0]
[88.0, 104.0]
[326, 301]
p03074
u788068140
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = 13, 1\nS = "0000011100110"\n\n# N, K = 2, 2\n# S = "00"\n\n\n# N, K = 1, 1\n# S = "1"\n#\n#\n# N, K = 5, 1\n# S = "00010"\n#\nN, K = map(int,input().split())\nS = input()\n\ndef calculate(n, k, s):\n s = list(s)\n\n result = [{\'start\': 0, \'end\': 0}]\n for i in range(n):\n\n previous = s[i -...
['Runtime Error', 'Accepted']
['s874002889', 's629559100']
[28264.0, 25244.0]
[105.0, 83.0]
[1212, 1083]
p03074
u794543767
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['\ndef get_input():\n N,K = [int(_) for _ in input().split()]\n S = [int(_) for _ in list(input())]\n return N,K,S\n\ndef solve(N,K,S):\n length = len(S)\n array = count_array(S)\n start_char = S[0]\n ans = find_max(array,K,start_char)\n return ans\n\ndef find_max(array,K,start_char):\n if ...
['Wrong Answer', 'Accepted']
['s562088092', 's027717070']
[6532.0, 6536.0]
[85.0, 84.0]
[1358, 1436]
p03074
u798818115
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['# coding: utf-8\n# Your code here!\nN,K=map(int,input().split())\nS=list(map(int,list(input())))\n\nl=[]\ncount=1\nfor i in range(N-1):\n if S[i]==S[i+1]:\n count+=1\n else:\n l.append(count)\n count=1\nl.append(count)\n\nans=0\nif S[0]==0:\n l=[0]+l\n\nif len(l)%2==0: \n l.append(0)\...
['Wrong Answer', 'Accepted']
['s011484641', 's443142195']
[5652.0, 5400.0]
[132.0, 98.0]
[576, 563]
p03074
u799000757
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k=map(int,input().split())\ns=list(map(int,input()))\nsp_list=[]\nsum=0\nsum_0=0\nfor i in range(n):\n if s[i]==1:\n sum+=1\n if sum_0>0:\n sp_list.append(sum_0)\n sum_0=0\n if i==(n-1):\n sp_list.append(sum)\n else:\n if i==0:\n sp_list.append(0)\n if i>0 and sum>0:\n sp_lis...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s735124592', 's858360798', 's963594323']
[8616.0, 8616.0, 8616.0]
[132.0, 133.0, 114.0]
[740, 740, 738]
p03074
u799691369
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\ns = input()\nss = []\n\ncnt = 0\nfor i in range(n):\n if i == 0 and s[i] == '0':\n ss.append(0)\n\n if i > 1 and s[i] != s[i-1]:\n ss.append(cnt)\n cnt = 0\n\n cnt += 1\n\nss.append(cnt)\n\nif s[-1] == '0':\n ss.append(0)\n\n#print(ss)\nans = 0\ni = 0...
['Wrong Answer', 'Accepted']
['s835698709', 's171551159']
[4476.0, 4468.0]
[87.0, 150.0]
[439, 530]
p03074
u800780376
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['"""\nmap(int,input().split())\n\n"""\nN,K = map(int,input().split())\nS = input()\ns = []\nfor i in range(0,len(S)):\n s.append(S[i])\n\n\nNums = []\nnow = 1\ncnt = 0\nfor i in range(0,N):\n if(s[i] == str(now)):\n cnt+=1\n else:\n Nums.append(cnt)\n now = 1-now\n cnt = 1\n\nif cn...
['Wrong Answer', 'Accepted']
['s465785146', 's657552491']
[8700.0, 8700.0]
[140.0, 151.0]
[664, 818]
p03074
u801049006
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\ns = list(input())\n\ncnt = []\nif s[0] == '0': cnt.append(0)\n\ni = 0\nwhile i < n:\n j = i\n while j < n and s[j] == s[i]:\n j += 1\n cnt.append(j- i)\n i = j\nif s[-1] == '0': cnt.append(0)\n\ncs = [0] * (len(cnt)+1)\nfor i in range(len(cnt)):\n cs[i+1] = cs[i...
['Runtime Error', 'Accepted']
['s583367134', 's925854848']
[8572.0, 8568.0]
[139.0, 153.0]
[415, 434]
p03074
u807028974
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K = map(int,input().split())\nS = list(map(int,input().split()))\ntmp = 1\ntbl = []\ncont = 0\nfor s in S:\n if s == tmp:\n cont += 1\n else:\n tbl.append(cont)\n cont = 1\n tmp = abs(tmp-1)\ntbl.append(cont)\nif len(tbl) % 2 == 0:\n tbl.append(0)\nmax = 0\nfor i in range(0,len(...
['Wrong Answer', 'Accepted']
['s403123790', 's945475900']
[3316.0, 10608.0]
[85.0, 116.0]
[389, 447]
p03074
u811169796
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k = map(int,input().split())\ns = list(map(int,input().strip()))\n\ndata = [[],[]]\nkey = 1\ncnt = 0\nfor i in range(n):\n if s[i] == key:\n cnt += 1\n if i == n-1:\n data[key].append(cnt)\n else:\n data[key].append(cnt)\n key ^= 1\n cnt = 1\n \nif len(data[0])...
['Wrong Answer', 'Accepted']
['s875956506', 's253800681']
[4748.0, 4752.0]
[105.0, 111.0]
[646, 647]
p03074
u814271993
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["N, K = map(int, input().split())\nS = input()\nL = [0]\nX = ['1']\npos = 0\nfor i in range(N):\n if S[i] != X[pos]:\n L.append(1)\n X.append(S[i])\n pos += 1\n else:\n L[pos] += 1\nwhile pos < 2 * K + 4:\n L.append(0)\n X.append('1')\n pos += 1\nL.append(0)\nX.append('1')\nn = len(L)\nfor i in range(...
['Wrong Answer', 'Accepted']
['s815029309', 's417389266']
[18600.0, 18632.0]
[118.0, 121.0]
[411, 420]
p03074
u814986259
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K=map(int,input().split())\nS=list(input())\nS=list(map(int,S))\ns=[]\ns.append(0)\nfor i in range(1,N):\n if S[i]==1 and S[i-1]==0:\n s.append(i-1)\n elif i==N-1 and S[i]==0:\n s.append(i)\ns.append(N)\nif len(s)<=K+2:\n print(len(S))\n exit(0)\nans=0\nfor i in range(1,max(len(s)-K,0)):\n ans=max(s[i+K]...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s194325749', 's334107302', 's700648270', 's312858554']
[5780.0, 12148.0, 6756.0, 8960.0]
[78.0, 197.0, 82.0, 119.0]
[330, 461, 339, 552]
p03074
u819048695
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['from collections import deque\nn,k=map(int,input().split())\ns=input()\nif n==1:\n print(1)\nelse:\n\ta=deque([])\n\tif s[0]=="1":\n \ta.append([0])\n\tfor i in range(1,n):\n \tif s[i-1:i+1]=="01":\n \ta.append([i])\n \telif s[i-1:i+1]=="10":\n \ta[-1].append(i-1)\n\tif s[n-1]=="1":\n \ta...
['Runtime Error', 'Runtime Error', 'Accepted']
['s345161034', 's652252179', 's603647716']
[3064.0, 2940.0, 12532.0]
[17.0, 17.0, 218.0]
[524, 533, 628]
p03074
u820351940
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n, k = map(int, input().split())\ns = list(map(lambda x: x == "1", list(input())))\n\nchange_flg = False\ncnt = 0\nilands = []\n\n\ndef cumsum(array):\n value = array[0]\n results = [value] * len(array)\n for index, elm in enumerate(array[1:], 1):\n value += elm\n results[index] = value\n re...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s385688005', 's483449101', 's566172938', 's195902205']
[16376.0, 14844.0, 11288.0, 11288.0]
[125.0, 93.0, 95.0, 91.0]
[942, 952, 968, 987]
p03074
u826929627
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K=map(int,input().split())\nS=input()\nL=[0]\n#even:1\n#odd:0\ntmp="0"\nfor i in range(N):\n if tmp!=S[i]:\n L.append(1)\n else:\n L[-1]+=1\n tmp=S[i]\n\nif tmp=="0":\n L.append(0)\n\n\nM=len(L)\n\nif M<=2*K+1:\n print(N)\n exit()\n\n\nX=[0 for i in range(M+1)]\nfor i in range(M):\n ...
['Wrong Answer', 'Accepted']
['s811433044', 's545872404']
[7880.0, 8004.0]
[94.0, 87.0]
[473, 1058]
p03074
u836939578
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["import sys\ninput = lambda: sys.stdin.readline().rstrip()\nfrom itertools import accumulate\n\n\nN, K = map(int, input().split())\n\nS = input()\n\nif len(S) == 1:\n print(1)\n exit()\n\ncum_sum = [0]\n\ntmp_S = S\n\nif S[-1] == '0':\n tmp_S += '1'\nelse:\n tmp_S += '0'\n\ncnt = 1\nfor i in range(len(tmp_...
['Runtime Error', 'Runtime Error', 'Accepted']
['s301560318', 's747125149', 's916705940']
[10196.0, 10224.0, 8804.0]
[152.0, 166.0, 93.0]
[795, 787, 655]
p03074
u839188633
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n, k = map(int, input().split())\ns = input()\n\nstart = [0]\nend = []\n\nif s[0] == "0":\n end.append(0)\n\nfor i, (c0, c1) in enumerate(zip(s, s[1:])):\n print(c0, c1)\n if c0 == "1" and c1 == "0":\n end.append(i + 1)\n elif c0 == "0" and c1 == "1":\n start.append(i + 1)\n\nif s[-1] == "1"...
['Wrong Answer', 'Accepted']
['s395006037', 's188586799']
[9840.0, 7484.0]
[158.0, 57.0]
[490, 453]
p03074
u843135954
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["import sys\nstdin = sys.stdin\n \nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\nn,k = na()\ns = ns()\nones = []\na = 0\nnow = '0'\n\nfor i in s:\n if i == now:\n a += 1\n else:\n ...
['Wrong Answer', 'Accepted']
['s634897532', 's202347322']
[79092.0, 7932.0]
[2104.0, 100.0]
[568, 648]
p03074
u844005364
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['\n_, k = map(int, input().split())\ns = input()\n\na = []\ncnt_one = 0\ncnt_zero = 0\n\nif s[0] == "0":\n a.append(0)\n\nfor i in s:\n if i == "1":\n cnt_one += + 1\n if cnt_zero != 0:\n a.append(cnt_zero)\n cnt_zero = 0\n else:\n cnt_zero += 1\n if cnt_one !...
['Wrong Answer', 'Accepted']
['s034449212', 's951897746']
[4732.0, 4480.0]
[119.0, 88.0]
[684, 670]
p03074
u858970803
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['def calc_seq(xs):\n seq = []\n count = 1\n for i in range(1, len(xs) - 1):\n if xs[i] == xs[i+1]:\n count += 1\n else:\n seq.append(count)\n count = 1\n seq.append(count)\n return seq\n\ndef form_seq(xs):\n seq = calc_seq(xs)\n if xs[0] == 0:\n ...
['Wrong Answer', 'Accepted']
['s154741844', 's468366054']
[5024.0, 5024.0]
[89.0, 74.0]
[834, 860]
p03074
u860649643
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["N, K = map(int, input().split())\nS = input()\n\narr = []\ncnt = 0\ncomp = S[0]\nfor s in S:\n if s==comp:\n cnt += 1\n else:\n if comp=='0':\n arr.append(-cnt)\n else:\n arr.append(cnt)\n cnt = 1\n comp = s\narr.append(cnt)\n\nif len(arr)<3:\n print(s...
['Wrong Answer', 'Accepted']
['s164258172', 's979837590']
[4596.0, 4596.0]
[2104.0, 132.0]
[580, 835]
p03074
u866242505
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["'''input\n5 1\n00010\n'''\n\n\nN, K=map(int,input().split())\nSstr=input()\n# print(Sstr)\nS=[]\n\nfor i in range(N):\n\tS.append(int(Sstr[i]))\n\n# print(S)\n# flip=0\n\n# \tflip+=abs(S[i+1]-S[i])\n# print(flip)\n\n\nnow=1\ncnt=0\nNums=[]\nfor i in range(N):\n\tif S[i]==now:\n\t\tcnt+=1\n\telse:\n\t\tNums.append(cnt...
['Wrong Answer', 'Accepted']
['s633316097', 's038133468']
[5016.0, 4860.0]
[163.0, 166.0]
[703, 706]
p03074
u867848444
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int,input().split())\ns = input()\n\nns = []\nnow_num = s[0]\ncnt = 0\nfor i in range(n):\n if now_num == s[i]:\n cnt += 1\n else:\n ns.append((now_num, cnt))\n now_num = s[i]\n cnt = 1\nns.append((now_num, cnt))\n#print(ns)\nlen_ns = len(ns)\npre = [0] * (len_ns + 1)\nfor...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s023678958', 's457993214', 's495734862', 's642528202']
[14284.0, 14284.0, 17824.0, 14284.0]
[144.0, 153.0, 210.0, 180.0]
[644, 648, 649, 628]
p03074
u870178975
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k=map(int,input().split())\ns=list(map(int,str(input())))\nif s[0]==1:\n a=[0]+[i+1 for i in range(n-1) if s[i]==0 and s[i+1]==1]\nelse:\n a=[i+1 for i in range(n-1) if s[i]==0 and s[i+1]==1]\nif s[n-1]==1:\n b=[i for i in range(n-1) if s[i]==1 and s[i+1]==0]+[n-1]\nelse:\n b=[i for i in range(n-1) if s[i]==1 a...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s131471234', 's406262006', 's649795357', 's659704007', 's671466301', 's729648752', 's898712937', 's996867609', 's997982847']
[11320.0, 13648.0, 13372.0, 13288.0, 14804.0, 13652.0, 13604.0, 13612.0, 13612.0]
[80.0, 101.0, 92.0, 98.0, 108.0, 100.0, 101.0, 103.0, 102.0]
[545, 775, 749, 752, 802, 774, 778, 778, 777]
p03074
u876705760
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['l, accum = len(s), []\ni = 0\nwhile i < l:\n ch = s[i]\n count = 0\n while i < l and s[i] == ch:\n count += 1\n i += 1\n accum.append(count)\n\nl = len(accum)\nfor i in range(1, l): accum[i] += accum[i-1]\n\nmx = accum[min(2*k - (1-int(s[0])), l-1)]\ni = 1\nwhile l > 1:\n idx = min(2*k - ...
['Runtime Error', 'Accepted']
['s155048994', 's652515030']
[3064.0, 7328.0]
[18.0, 138.0]
[530, 781]
p03074
u879309973
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['def solve(n, k, s):\n v = []\n if s[0] == "0":\n v.append(0)\n i = 0\n while i < n:\n num = 1\n while (i+1 < n) and (s[i+1] == s[i]):\n num += 1\n i += 1\n v.append(num)\n i += 1\n if s[n-1] == "0":\n v.append(0)\n m = len(v)\n w = [...
['Wrong Answer', 'Accepted']
['s711774705', 's649319587']
[7884.0, 7884.0]
[125.0, 93.0]
[622, 688]
p03074
u879870653
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K = map(int,input().split())\nS = input() + "#"\nA = []\ncnt = 1\nfor i in range(N) :\n if S[i] == S[i+1] :\n cnt += 1\n else :\n A.append(cnt)\n cnt = 1\n\nif S[0] == "1" :\n ans = sum(A[:2*K+1])\n calc = ans\n for i in range(2*K+1, len(A)) :\n calc += A[i]\n if i ...
['Runtime Error', 'Accepted']
['s321228889', 's285424184']
[4476.0, 4596.0]
[94.0, 113.0]
[629, 644]
p03074
u882359130
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = input().split()\nN = int(N)\nK = int(K)\nS = input()\nA = []\nfor i in range(len(S)-1):\n if (S[i]=="0" and S[i+1]=="1") or (S[i]=="1" and S[i+1]=="0"):\n A.append(i+1)\nA.insert(0, 0)\nA.append(N)\nM = []\na = 0\nwhile a <= len(A)-K*2-1:\n b = a + K*2 + 1\n M.append(A[b]-A[a])\n a += 2\npri...
['Runtime Error', 'Accepted']
['s324860101', 's020018780']
[8760.0, 8688.0]
[86.0, 83.0]
[312, 754]
p03074
u886633618
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = map(int, input().split())\n\n\nS = input()\nindex_array = [0]\nnow_letter = "1"\nfor i, s in enumerate(S):\n if s != now_letter:\n now_letter = s\n index_array.append(i)\nelse:\n if now_letter == "1":\n index_array.append(N)\n# print(index_array)\n# print(index_array)\nans = 0\narray...
['Wrong Answer', 'Accepted']
['s162663455', 's153243768']
[7156.0, 7156.0]
[67.0, 68.0]
[599, 656]
p03074
u887207211
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['def main():\n n, k = map(int,input().split())\n s = input()\n\n from itertools import groupby\n\n tmp = []\n num = []\n for ke, v in groupby(s):\n num.append(ke)\n tmp.append(len(list(v)))\n \n num += [0]\n tmp += [0]\n\n nt = len(tmp)\n wa = [0] * (nt+1)\n for i in range(nt):\n wa[i+1] = wa[i] +...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s147609218', 's154236662', 's361422757', 's738397381']
[11280.0, 8792.0, 14292.0, 8772.0]
[137.0, 118.0, 190.0, 117.0]
[536, 535, 519, 515]
p03074
u904804404
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = tuple(map(int, input().split()))\nS = "1"+input()+"1"\n\nprev = S[0]\nif prev == "0":\n fst_is_0 = True\nelse:\n fst_is_0 = False\n\ncnt = 0\ncnt_0 = 0\n\ncnt_lst = []\nfor idx, s in enumerate(S):\n if s == prev:\n cnt += 1\n else:\n cnt_lst.append(cnt)\n if s == "0":\n cnt_0 += 1\n prev =...
['Runtime Error', 'Accepted']
['s554898270', 's576809789']
[4872.0, 8760.0]
[66.0, 121.0]
[684, 849]
p03074
u920204936
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N,K = [int(i) for i in input().split()]\nS = list(map (int, list(input())))\nstart = S[0]\nrow = []\nstate = [0,start]\nfor i in S:\n if i == start:\n state[0] += 1\n else:\n row.append(state)\n start = i\n state = [1,i]\nrow.append(state)\nprint(row)\nans = []\nfor i in range(max(le...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s306811479', 's322003090', 's470594005', 's742535602', 's299493255']
[18360.0, 16532.0, 16240.0, 16276.0, 13300.0]
[2104.0, 2104.0, 178.0, 2104.0, 151.0]
[519, 557, 675, 586, 672]
p03074
u923270446
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n, k = map(int, input().split())\ns = input()\nl = [0]\nfor i in range(n - 1):\n if s[i] != s[i + 1]:\n l.append(i + 1)\nl += [n]\nle = len(l)\nans = 0\nfor i in range(le - 1):\n if s[l[i]] == "0":\n ans = max(ans, l[min(le, k * 2 + i)] - l[i])\n else:\n ans = max(ans, l[min(le, k * 2 + ...
['Runtime Error', 'Accepted']
['s656077010', 's842788646']
[12976.0, 13060.0]
[106.0, 111.0]
[331, 339]
p03074
u926181697
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N , K = map(int,input().split())\nS = input()\nL = []\nflag = int(S[0])\nfor x in S:\n L.append(x)\ncnt = 1\nC = []\nfor i in range(len(L)):\n try:\n if L[i] == L[i+1]:\n cnt += 1\n else:\n C.append(cnt)\n cnt = 1\n except:\n pass\nC.append(cnt)\nans = 0\...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s018266327', 's777172663', 's910754187', 's031045315']
[3064.0, 9472.0, 10852.0, 9496.0]
[20.0, 166.0, 128.0, 181.0]
[703, 700, 1032, 953]
p03074
u927534107
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k=map(int,input().split())\ns=list(input())\nl,tmpl,cnt0,tmp,flag=[],0,0,s[0],0\nif tmp=="0":cnt0+=1;flag=1\nfor i in s:\n if i==tmp:tmpl+=1\n else:\n if i=="0":cnt0+=1\n tmp=i\n l.append(tmpl)\n tmpl=1\nl.append(tmpl)\nif cnt0<=k:print(n);exit()\nans=max(sum(l[:2*k]),sum(l[::-1][:...
['Runtime Error', 'Runtime Error', 'Accepted']
['s050849821', 's397859379', 's434542920']
[9464.0, 9208.0, 9040.0]
[125.0, 87.0, 93.0]
[512, 497, 555]
p03074
u940102677
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k = map(int,input().split())\ns = input()\n\na = [0]\ni = 0\np = "1"\nfor t in s:\n if t == p:\n a[i] += 1\n else:\n p = t\n i += 1\n a += [1]\n# print(a)\n\nif len(a) <= 2*k+1:\n print(n)\n quit()\n\nx = sum(a[:2*k+1])\nm = x \nfor i in range(2*k+1,len(a)):\n # print(i)\n x = x + a[i] - a[i-(2*k+...
['Wrong Answer', 'Accepted']
['s492822987', 's595053071']
[4596.0, 4468.0]
[102.0, 93.0]
[323, 374]
p03074
u940852449
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['# coding: utf-8\n# Your code here!\nN, K = [int(_) for _ in input().split()]\nS = str(input())\n\nNums = []\nnow, cnt = 1, 0\nfor i in range(N):\n if S[i] == str(now): cnt += 1\n else:\n Nums.append(cnt)\n now = 1 - now\n cnt = 1\nif cnt != 0: Nums.append(cnt)\nif len(Nums) % 2 == 0: Nums.a...
['Wrong Answer', 'Accepted']
['s728550116', 's017203154']
[4092.0, 7884.0]
[185.0, 130.0]
[915, 1326]
p03074
u941753895
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n,k=map(int,input().split())\ns=input()\ns+='a'\nl=[]\na=s[0]\n\nif a=='0':\n f=0\nelse:\n f=1\n\nfor x in s[1:]:\n if a[0]!=x:\n l.append(len(a))\n a=x\n else:\n a+=x\n\nif len(l)%2==0:\n pass\nelse:\n l=l+[0]\n\nl2=[]\n\nif f==1:\n pass\nelse:\n l2=[0]+l2\n\nfor i in range(len(l)):\n if i%2==0:\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s117099077', 's171893580', 's678080534', 's689405175', 's807348323', 's999486513']
[4992.0, 10512.0, 10944.0, 4980.0, 11240.0, 10564.0]
[108.0, 97.0, 88.0, 73.0, 134.0, 101.0]
[448, 1095, 1005, 431, 1155, 1155]
p03074
u952022797
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['# -*- coding: utf-8 -*-\nimport sys\nimport math\nfrom bisect import bisect_left\nfrom bisect import bisect_right\nimport collections\ninput = sys.stdin.readline\n\n\n\n\ndef main():\n\tN, K = map(int, input().split(" "))\n\tSS = input()\n\tSS_org = SS.rstrip("\\n")\n\tS = SS.rstrip("\\n")\n\t\n\tS_tmp = S.split("1")...
['Wrong Answer', 'Accepted']
['s528013403', 's117491261']
[7028.0, 8748.0]
[31.0, 869.0]
[544, 1732]
p03074
u955251526
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\ns = input()\nseq = []\npre = '1'\ncount = 0\nfor c in s:\n if c == pre:\n count += 1\n else:\n pre = c\n seq.append(count)\n count = 1\nseq.append(count)\n\nn = len(seq)\nsum = sum(seq[:2*k + 1])\nans = sum\nfor i in range(0, n - 2*k - 3, 2):\n su...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s159376732', 's268917406', 's659590885', 's759932557', 's802543180', 's947423623', 's523931696']
[4596.0, 4468.0, 4596.0, 4596.0, 4596.0, 4468.0, 4596.0]
[78.0, 2104.0, 86.0, 92.0, 2104.0, 62.0, 82.0]
[416, 295, 369, 361, 452, 382, 422]
p03074
u957167787
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['N, K = map(int, input().split())\nS = input()\n\nl = []\nnow = 1 \ncnt = 0\n\n\nfor i in range(N):\n if int(S[i]) == now:\n cnt += 1\n else:\n l.append(cnt)\n cnt = 1\n now = 1 - now \nif cnt != 0:\n l.append(cnt)\nif len(l) % 2 == 0: \n l.append(0)\nprint(l)\n\nans = 0\nwidth ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s240347223', 's682988844', 's846392032']
[10488.0, 4860.0, 8004.0]
[143.0, 2104.0, 129.0]
[2109, 967, 2111]
p03074
u969190727
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['n,k=map(int,input().split())\ns=input()\nList=[]\ni=1\nj=1\nwhile i<n:\n if s[i-1]==s[i]:\n j+=1\n i+=1\n else:\n List.append(j)\n i+=1\n j=1\nList.append(j)\nif s[0]=="0":\n List.insert(0,0)\nans=max(List)\nrg=2*k+1\n\n# m=sum(List[i:i+rg])\n# ans=max(ans,m)\nprint(ans)', 'n,k=map(int,input().spl...
['Wrong Answer', 'Accepted']
['s088616218', 's459351960']
[4212.0, 7168.0]
[55.0, 70.0]
[306, 549]
p03074
u970197315
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["# ABC124 D - Handstand\nfrom math import ceil\nn,k=map(int,input().split())\ns=input()\n\nl=[]\ntmp=''\nt_cnt=0\nfor i,ss in enumerate(s):\n if i==0:\n tmp=ss\n t_cnt+=1\n if len(s)==1:\n l.append(t_cnt)\n break\n continue\n if i==n-1:\n if ss==tmp:\n ...
['Runtime Error', 'Accepted']
['s136506339', 's464478168']
[4476.0, 8712.0]
[69.0, 117.0]
[871, 354]
p03074
u970308980
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["from itertools import groupby\nfrom numpy import cumsum\n\n\nN, K = map(int, input().split())\nS = input().strip()\n\nif len(set(S)) == 1:\n print(N)\n exit()\n\n\nG = []\nfor k, v in groupby(S):\n G.append(len(list(v)))\n\n\nif S[0] == '0':\n G.insert(0, 0)\nif S[-1] == '0':\n G.append(0)\n\ncum = [0]...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s248110213', 's581574049', 's308183027']
[17872.0, 17868.0, 17876.0]
[259.0, 257.0, 255.0]
[598, 454, 602]
p03074
u982594421
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["n, k = map(int, input().split())\ns = input().rstrip()\nans = 1\ni = 0\nleft = 0\nright = 1\nwhile i < n:\n if k > 0:\n pos = s.find('01', i)\n if pos == -1:\n i = n\n right = n - 1\n else:\n pos = s.find('10', pos + 1)\n if pos == -1:\n ...
['Runtime Error', 'Accepted']
['s139678021', 's201623208']
[134388.0, 3316.0]
[213.0, 96.0]
[601, 570]
p03074
u984276646
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["N, K = map(int, input().split())\nS = input()\nL = [0, 1]\nX = ['1', S[0]]\npos = 1\nfor i in range(1, N):\n if S[i] != S[i-1]:\n L.append(1)\n X.append(S[i])\n pos += 1\n else:\n L[pos] += 1\nwhile pos < 2 * K + 2:\n L.append(0)\n X.append('1')\n pos += 1\nfor i in range(1, pos+1):\n L[i] += L[i-1]...
['Wrong Answer', 'Accepted']
['s441732343', 's469325399']
[18740.0, 18628.0]
[130.0, 124.0]
[405, 420]
p03074
u989345508
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['from sys import exit\ndef groupby(a):\n a2=[[a[0],1]]\n for i in range(1,len(a)):\n if a2[-1][0]==a[i]:\n a2[-1][1]+=1\n else:\n a2.append([a[i],1])\n return a2\n\nn,k=map(int,input().split())\ns=list(input())\nx=groupby(s)\nl=len(x)\ny=[x[i][1] for i in range(l)]\n\nif\n\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s379295500', 's893196064', 's787391362']
[3064.0, 15148.0, 15156.0]
[17.0, 121.0, 129.0]
[699, 701, 757]
p03074
u993435350
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
['from collections import deque\n\n\nN,K = map(int,input().split())\nS = input()\n\nif N == 1:\n if S == "1" or K >= 1:\n print(1)\n else:\n print(0)\n \nelse:\n num = deque([])\n if S[0] == "0":\n num.append(0)\n cnt = 1\n ans = 0\n M = 2 * K + 1\n \n for i in range(1,N):\n if S[i] == S[i - 1]:...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s536203378', 's834502457', 's942191880', 's505634489']
[3700.0, 9888.0, 3444.0, 9632.0]
[2104.0, 64.0, 25.0, 94.0]
[563, 645, 648, 624]
p03074
u997641430
2,000
1,048,576
N people are arranged in a row from left to right. You are given a string S of length N consisting of `0` and `1`, and a positive integer K. The i-th person from the left is standing on feet if the i-th character of S is `0`, and standing on hands if that character is `1`. You will give the following direction at mo...
["N, K = map(int, input().split())\nS = input()\nT = []\ncount = 1\nfor n in range(N - 1):\n s0, s1 = S[n], S[n + 1]\n if s0 == s1:\n count += 1\n else:\n T.append(count)\n count = 1\nT.append(count)\nif S[0] == '0':\n T = [0] + T\nif S[-1] == '0':\n T = T + [0]\nL = len(T)\nif 2 * K...
['Wrong Answer', 'Accepted']
['s755670971', 's328326639']
[4864.0, 4864.0]
[90.0, 91.0]
[630, 622]
p03075
u003501233
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a=int(input())\nb=int(input())\nc=int(input())\nd=int(input())\ne=int(input())\nk=int(input())\n\ns=[a,b,c,d,e,k]\n\nif s[5]-s[0] <= s[6]:\n print("Yay!")\nelse:\n print(":(")', 's = [input() for i in range(6)]\nif s[5]-s[0] < s[6]:\n print("Yay!")\nelse:\n print(":(")', 'a=int(input())\nb=int(input())\nc=int(inp...
['Runtime Error', 'Runtime Error', 'Accepted']
['s488627027', 's879117739', 's272229573']
[3064.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[165, 88, 139]
p03075
u008582165
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['allist = []\nfor i in range(6):\n num = int(input())\n if i == 5:\n k = num\n else:\n alllist.append(num)\n\ndiflist = []\nfor i in range(4):\n diflist.append(alllist[i+1]-alllist[i])\n\nfor i in diflist:\n if i > k:\n print(":(")\n break\nelse:\n print("Yay!")', 'a = int...
['Runtime Error', 'Accepted']
['s092598251', 's861181519']
[3060.0, 3060.0]
[17.0, 17.0]
[290, 151]
p03075
u011634450
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['# https://img.atcoder.jp/abc123/editorial.pdf\n\n\nfrom heapq import heappush, nlargest\n\ndef solve(X, Y, Z, K, A, B, C):\n A.sort(reverse=True)\n B.sort(reverse=True)\n C.sort(reverse=True)\n\n Q = []\n for a in A:\n for b in B:\n heappush(Q, a+ b)\n AB = nlargest(K, Q)\n\n Q2...
['Runtime Error', 'Accepted']
['s853713128', 's498361428']
[3064.0, 3060.0]
[18.0, 18.0]
[765, 197]
p03075
u013594089
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['lst=[]\nfor i in 5:\n\tlst.append(int(input()))\nk = int(input())\nsor = sorted(lst)\nif sor[4] - sor[0] > k:\n\tprint(":(")\nelse:\n\tprint("Yay!")\n', 'lst=[]\nfor i in range(5):\n\tlst.append(int(input()))\nprint(lst)\nk = int(input())\nsor = sorted(lst)\nif sor[4] - sor[0] > k:\n\tprint(":(")\nelse:\n\tprint("Yay...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s006457245', 's815377236', 's379022978']
[2940.0, 2940.0, 2940.0]
[17.0, 18.0, 17.0]
[138, 156, 145]
p03075
u013605408
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a,b,c,d,e,k = map(int,open(0).read().split())\nprint("yay!" if max(a,b,c,d,e) - min(a,b,c,d,e) <= k else ":(")', 'a,b,c,d,e,k = (int(input()) for i in range(6))\nprint("Yay!" if e-a<=k else ":(")']
['Wrong Answer', 'Accepted']
['s242266874', 's671730978']
[2940.0, 2940.0]
[18.0, 17.0]
[109, 80]
p03075
u014333473
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["n=[int(input()) for _ in range(6)];print([':(','Yay'][max(n[:5])-min(n[:5])<=n[5]])", "n=[int(input()) for _ in range(6)];print([':(','Yay!'][n[4]-n[0]<=n[5]])"]
['Wrong Answer', 'Accepted']
['s881152865', 's633177289']
[9128.0, 8900.0]
[24.0, 26.0]
[83, 72]
p03075
u017624958
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nk = int(input())\n\nmax_distance = e - a\ncan_communicate = max_distance > k\n\nanswer = ':(' if not can_communicate else 'Yay!'\nprint(answer)\n", "a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int...
['Wrong Answer', 'Accepted']
['s225247118', 's437134176']
[3060.0, 3060.0]
[17.0, 17.0]
[223, 224]
p03075
u021548497
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['x, y, z, k = map(int, input().split())\na = [int(x) for x in input().split()]\nb = [int(x) for x in input().split()]\nc = [int(x) for x in input().split()]\na.sort(reverse=True)\nb.sort(reverse=True)\nc.sort(reverse=True)\nans_list = []\nfor i in a:\n for j in b:\n ans_list.append(i+j)\nans_list.sort(revers...
['Runtime Error', 'Accepted']
['s342524515', 's747790183']
[3064.0, 2940.0]
[18.0, 17.0]
[511, 155]
p03075
u023229441
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['A=[int(input()) for i in range(5)]\nk=int(input())\n\nfor i in range(4):\n\tfor i in range(i):\n\t\tif A[i]-A[j]>k:\n\t\t\tprint(""":(""")\n\t\t\texit()\nprint("Yay!")', 'A=[int(input()) for _ in range(5)]\nk=int(input())\n\nfor i in range(5):\n for j in range(i):\n if A[i]-A[j]>k:\n print(":(")\n exit(...
['Runtime Error', 'Accepted']
['s727748743', 's799079466']
[2940.0, 2940.0]
[17.0, 17.0]
[150, 155]
p03075
u023540496
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nk = int(input())\nif max(e-a) > k:\n print(":(")\nelse:\n print("Yay!")', 'a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nk = int(input())\nif e-a > k:\n print(":(")\nelse:\n ...
['Runtime Error', 'Accepted']
['s911235588', 's155599305']
[3060.0, 3060.0]
[17.0, 17.0]
[158, 153]
p03075
u025363805
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a = int(input())\nb = input()\nc = input()\nd = input()\ne = int(input())\nk = input()\nx = e-a\nif x <= k:\n print("Yay!")\nelse:\n print(":(")\n', 'a = int(input())\nb = input()\nc = input()\nd = input()\ne = int(input()\nk = input()\nif e - a <= k:\n print("Yay!")\nelse:\n print(":(")\n', 'a = int(inpu...
['Runtime Error', 'Runtime Error', 'Accepted']
['s014609770', 's941278859', 's833420628']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[141, 136, 157]
p03075
u027675217
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a = ([map(int, input())for _ in range[5]])\nk = int(input())\nans="Yay!"\nfor i in range(1,4):\n\tif k < a[i]-a[0]:\n\t\tans=":("\nprint(ans)\n', 'a = ([int(input())for _ in range(5)])\nk = int(input())\nans="Yay!"\nfor i in range(1,5):\n\tif k < a[i]-a[0]:\n\t\tans=":("\nprint(ans)\n']
['Runtime Error', 'Accepted']
['s134120233', 's015287342']
[2940.0, 2940.0]
[17.0, 17.0]
[133, 128]
p03075
u027929618
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['L=[int(input()) for _ in range(5)]\nk=int(input())\nfor i in range(1,5):\n if L[i]-L[i-1]>0:\n print(":(")\n exit()\nprint("Yay!")', 'L=[int(input()) for _ in range(5)]\nk=int(input())\nfor i in range(4):\n for j in range(i+1,5):\n if L[j]-L[i]>k:\n print(":(")\n exit()\nprint("Yay!")\n']
['Wrong Answer', 'Accepted']
['s585949645', 's609026091']
[2940.0, 2940.0]
[17.0, 17.0]
[131, 159]
p03075
u028489522
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['li = input("lkdfkgkfg").split()\nt = 0\ns = int(li.pop(5))\nfor i in li:\n for k in li:\n if int(k) - int(i) >= s:\n t = 1\n\nif t == 0:\n print("Yay!")\nelse:\n print(":(")\n\nwhile True:\n s += 1', '#coding:utf-8\n\nli = input("lkdfkgkfg").split()\nt = 0\ns = int(li.pop(5))\nfor i in l...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s529001149', 's794087498', 's900998718', 's973803256', 's797498368']
[3060.0, 3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0]
[213, 204, 245, 219, 263]
p03075
u030649913
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nk = int(input())\n\nif (e-k) > 0:\n print('Yay!')\nelse:\n print(':(')", "a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nk = int(input())\n\nif (e-k) >= 0:\n print('Yay!')\nels...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s491035462', 's567868477', 's244331738']
[3060.0, 3060.0, 3060.0]
[18.0, 17.0, 18.0]
[156, 157, 202]
p03075
u030992242
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["a=[]\n\nfor i in range(6):\n a.append(int(input())\n\na=a.sort()\nif(a[4]-a[0]>a[5]):\n print(':(')\nelse:\n print('Yay!')", "a=[]\n\nfor i in range(6):\n a.append(int(input())\n\na=a.sort()\nif(a[4]-a[0]>a[5]):\n print(':(')\nelse:\n print('Yay!')", "a=[]\n\nfor i in range(6):\n a.append(int(input...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s309424710', 's429869854', 's955961365', 's977186115']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 18.0]
[120, 122, 121, 263]
p03075
u032031842
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a = [int(input()) for i in range(6)]\n\n\ni = [a[0], a[1], a[2], a[3], a[4]]\nk = a[5]\n\nflag = False\nitr = 0\nwhile True:\n x = itr\n while True:\n x++\n if \n break\n else if(i[itr] - i[x]) > k:\n flag = True\n itr++\n if itr == 5\n break\n \nif flag\n print(":(")\nelse\n print("Yay...
['Runtime Error', 'Accepted']
['s728172349', 's373130868']
[2940.0, 3064.0]
[17.0, 17.0]
[333, 343]
p03075
u032955959
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["a=int(inout())\nb=int(inout())\nc=int(inout())\nd=int(inout())\ne=int(inout())\nk=int(inout())\n\nv=b-a\nw=c-b\nx=d-c\ny=e-d\n\nz=max(max(v,w),max(x,y))\n\nif z >k:\n print(':')\nelse:\n print('Yay!)", "a=int(inout())\nb=int(inout())\nc=int(inout())\nd=int(inout())\ne=int(inout())\nk=int(inout())\n\nv=b-a\nw=c-b\nx...
['Runtime Error', 'Runtime Error', 'Accepted']
['s198050067', 's978254680', 's364052292']
[3064.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[184, 186, 144]
p03075
u035445296
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["ans = [int(input()) for _ in range(6)]\nprint(':(' if abs(ans[0]-ans[4]) <= ans[-1] else 'Yay!')", "ans = [int(input()) for _ range(6)]\nprint(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')", "ans = [int(input()) for _ range(6)]\nprint(':(' if abs(ans[0]-ans[4]) <= ans[-1] else 'Yay!')", "ans = [int(input()) for _...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s303527618', 's457333078', 's527310533', 's473076429']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[95, 91, 92, 94]
p03075
u037074041
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["from sys import stdin\nimport math\nimport itertools\n\n\ndef makeIntMatrix(lines):\n intMatrix = []\n for a in makeStringMatrix(lines):\n intMatrix.append([int(b) for b in a])\n return intMatrix\n \n \ndef makeStringMatrix(lines):\n stringMatrix = [line.split() for line in lines]\n return strin...
['Wrong Answer', 'Accepted']
['s660941773', 's802732485']
[3064.0, 3064.0]
[18.0, 18.0]
[1462, 941]
p03075
u038216098
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a[0]=int(input())\na[1]=int(input())\na[2]=int(input())\na[3]=int(input())\na[4]=int(input())\nk=int(input())\nfor i in range(5):\n for j in range(i+1,5):\n if a[j]-a[i]>k :\n print(":(")\n sys.exit()\nprint("Yay!")', 'import sys\na=[0]*5\na[0]=int(input())\na[1]=int(input())\na[2]=int(input())\na[3]=in...
['Runtime Error', 'Accepted']
['s843287376', 's344185329']
[9204.0, 9212.0]
[24.0, 28.0]
[218, 237]
p03075
u039189422
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['from sys import exit\n\nA=[int(input()) for _ in range(5)]\nk=int(input())\n\nif max(A)-min(A)>k:\n\tprint(":(")\nelse:\n\tprint("Yay!', 'A=[int(input()) for _ in range(5)]\nk=int(input())\n\nif max(A)-min(A)>k:\n\tprint(":(")\nelse:\n\tprint("Yay!', 'A=[int(input()) for _ in range(5)]\nk=int(input())\n\nif (max(A)-m...
['Runtime Error', 'Runtime Error', 'Accepted']
['s369637371', 's671463270', 's199353212']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[124, 102, 106]
p03075
u039623862
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
["v=[int(input()) for_ in range(6)]\nprint('Yay!' if all([abs(v[i]-v[i+1])<=v[5] for i in range(4)) else ':(')", "v=[int(input()) for_ in range(6)]\nprint('Yay!' if v[4]-v[0]<=v[5] else ':(')\n", "v=[int(input()) for_ in range(6)]\nprint('Yay!' if all([v[i+1]-v[i]<=v[5] for i in range(4)]) else ':(')\n", "a = int(input...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s428150228', 's760188742', 's933359088', 's304222231']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 18.0]
[107, 77, 104, 155]
p03075
u042385277
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a = int(input())\nb = int(input())\nc = int(input())\nd = int(input())\ne = int(input())\nk = int(input())\nif e-a > k:\n print(":(")\nelse:\n print("Yey!")\n', "a=int(input())\nb=int(input())\nc=int(input())\nd=int(input())\ne=int(input())\nk=int(input())\nif e - a > k :\n print(':(')\nelse :\n print('Ye...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s467933164', 's696711289', 's721651336', 's841886992', 's877122805', 's904895552', 's971136219', 's942161182']
[2940.0, 2940.0, 3060.0, 2940.0, 3060.0, 3060.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[154, 146, 146, 154, 158, 154, 97, 152]
p03075
u043074390
2,000
1,048,576
In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively. Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k...
['a = []\nfor i in (5):\n a += [int(input())]\na.sort()\nkekka = ":("\nif a[4] - a[0] <= k:\n kekka = "Yay!"\nprint(kekka)', 'a = []\nfor i in (5):\n a += [int(input())]\nk = int(input())\na.sort()\nkekka = ":("\nif a[4] - a[0] <= k:\n kekka = "Yay!"\nprint(kekka)', 'a = []\nfor i in range (5):\n a += [int(input()...
['Runtime Error', 'Runtime Error', 'Accepted']
['s331397789', 's837447675', 's345131501']
[2940.0, 2940.0, 3060.0]
[18.0, 17.0, 17.0]
[115, 132, 138]