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
p03785
u323680411
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['import java.util.*\n\nfun main(args: Array<String>) {\n val sc = Scanner(System.`in`)\n\n val n = sc.nextInt()\n val c = sc.nextInt()\n val k = sc.nextInt()\n val t = Array(n) { sc.nextInt() }\n\n var ans = 0\n var waitStart = 0\n var waitPeople = 0\n\n for (ti in t.sorted()) {\n if (ti - waitStart > k || waitPeople == c) {\n waitPeople = 0\n }\n waitPeople++\n\n if (waitPeople == 1) {\n waitStart = ti\n ans++\n }\n }\n println(ans)\n}\n', "import sys\n\ndef main() -> None:\n n, c, k = map(int, input().split())\n t = [int(sys.stdin.readline()) for _ in range(n)]\n ans = wait_start = wait_people = 0\n\n for ti in sorted(t):\n if ti - wait_start > k or wait_people == c:\n wait_people = 0\n wait_people += 1\n\n if wait_people == 1:\n wait_start = ti\n ans += 1\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"]
['Runtime Error', 'Accepted']
['s580909730', 's670015799']
[2940.0, 8280.0]
[17.0, 114.0]
[515, 431]
p03785
u341267151
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int,input().split())\nt=[0]*n\nfor i in range(n):\n t[i]=int(input())\nt.sort()\ns=0\nlt=0\nln=0\nfor i in range(n):\n\n if i==0:\n lt=i\n ln+=1\n else:\n if t[i]-t[lt]>k:\n s+=1\n lt=i\n ln=1\n\n if ln==c:\n s+=1\n lt=i\n ln=0\n else:\n ln+=1\n print(i, s, lt, ln)\n\n\nif t[n-1]-t[lt]>k:\n s+=1\n ln+=1\n \nif ln>0:\n s+=1\n\nprint(s)', 'import math\nn,c,k=map(int,input().split())\nt=[0]*n\ns=0\na=0\nfor i in range(n):\n\tt[i]=int(input())\n if i>0 and a>0:\n if t[i]-t[i-1]<=k:\n s+=(a+n)//c\n a=(a+n)%c\n else:\n \ts+=math.ceil((a+n)/c)\n a=0\nprint(s)', 'n,c,k=map(int,input().split())\nt=[0]*n\nfor i in range(n):\n t[i]=int(input())\nt.sort()\ns=0\nlt=0\nln=0\n\nif c==1:\n print(n)\n exit()\nfor i in range(n):\n\n if i==0:\n lt=i\n ln+=1\n\n else:\n if t[i]-t[lt]>k:\n s+=1\n lt=i\n ln=0\n\n ln+=1\n if ln==c:\n s+=1\n lt=i+1\n ln=0\n\n #print(i, s, lt, ln)\n\n\n \nif ln>0:\n s+=1\n\nprint(s)\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s402246434', 's620190887', 's168348862']
[13384.0, 8976.0, 13384.0]
[301.0, 27.0, 195.0]
[449, 241, 433]
p03785
u347184682
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=[int(x) for x in input().rstrip().split()]\nt=[]\nfor i in range(n):\n T = int(input())\n t.append([T,T+k])\n\nt=sorted(t,key=lambda x :x[0])\n\nans=0\nright=t[0][1]\ncnt=0\nfor i in range(n):\n s,e=t[i][0],t[i][1]\n\n if s<=right<=e:\n cnt+=1\n\n if cnt==c:\n ans+=1\n cnt=0\n if i+1<n-1:\n right=t[i+1][1]\n\n else:\n ans+=1\n cnt=0\n if i+1<n-1:\n right=t[i+1][1]\n\nans+=cnt\nprint(ans)', 'n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n T=int(input())\n t.append(T)\n\nt.sort()\nans=1\npas=0\ndepa=t[0]+k\n\nfor i in range(n):\n if c==pas or depa<t[i]:\n ans+=1\n pas=1\n depa=t[i]+k\n else:\n pas+=1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s687619021', 's986906469']
[26284.0, 13388.0]
[292.0, 191.0]
[413, 233]
p03785
u367130284
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['a,b,c=map(int,input().split())\nv=sorted([int(input())for i in range(a)])\nprint(v)\nbus=[]\nans=0\nfor i in range(a-1):\n \n if v[i]+c<v[i+1]:\n ans+=1\n bus=[]\n if i==a-2:\n ans+=1\n else:\n bus.append(v[i])\n print(bus)\n if len(bus)>=b:\n ans+=1\n bus=[]\nif len(bus)>0:\n ans+=1\nprint(ans)', 'n,c,k=map(int,input().split())\nbus=0\ntotalbus=0\nfor i in range(n):\n t=int(input())\n if bus==0:\n time=t\n if time<=t<=time+k:\n bus+=1\n if bus==c:\n bus=0\n totalbus+=1\n else:\n bus=0\n totalbus+=1\n print(bus,time)\nprint(totalbus)\n', 'n,c,k=map(int,input().split())\nbus=0\ntotalbus=1\nfor i in range(n):\n t=int(input())\n if bus==0:\n time=t\n if time<=t<=time+k:\n bus+=1\n if bus==c:\n bus=0\n totalbus+=1\n else:\n bus=0\n totalbus+=1\n print(bus,time)\nprint(totalbus)\n', 'n,c,k=map(int,input().split())\nbus=0\ntotalbus=0\nfor t in sorted([int(input())for i in range(n)]):\n if bus==0:\n time=t\n totalbus+=1\n if time<=t<=time+k:\n bus+=1\n if bus==c:\n bus=0\n else:\n bus=0\n #print(bus,totalbus,time)\nprint(totalbus)', 'n,c,k=map(int,input().split())\nbus=0\ntotalbus=0\nfor t in sorted([int(input())for i in range(n)]):\n if bus==0:\n time=t\n totalbus+=1\n if time<=t<=time+k:\n bus+=1\n if bus==c:\n bus=0\n else:\n bus=0\n print(bus,totalbus,time)\nif bus==0:\n totalbus+=1\nprint(totalbus)', 'n,c,k,*t=map(int,open(0).read().split())\nt.sort()\ntotalbus=1\nbus=0\ntime=t[0]\nfor i in range(n):\n bus+=1\n if t[i]>time+k or bus>c:\n time=t[i]\n totalbus+=1\n bus=1\nprint(totalbus)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s213132907', 's297996858', 's374151395', 's896674219', 's907395825', 's115449048']
[138856.0, 4212.0, 4212.0, 8280.0, 9024.0, 14052.0]
[1718.0, 800.0, 806.0, 247.0, 390.0, 112.0]
[363, 296, 296, 293, 319, 203]
p03785
u379559362
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\nt.sort()\n\nbus = 1\nnew_bus = False\nstart_time = 0\ncapacity = 0\n\nwhile t:\n if new_bus:\n new_bus = False\n bus += 1\n capacity = 0\n\n time = t.pop(0)\n if capacity == 0:\n start_time = time\n wait_time = time - start_time\n capacity += 1\n\n if capacity == c:\n new_bus = True\n continue\n if wait_time > k:\n if (t == []) or (t[0] - wait_time <= k):\n new_bus = True\n continue\n\nprint(bus)', 'n, c, k = map(int, input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\nt.sort()\n\nbus = 0\nnew_bus = True\nstart_time = 0\ncapacity = 0\n\nwhile t:\n time = t[0]\n if new_bus:\n new_bus = False\n capacity = 0\n start_time = time\n bus += 1\n\n wait_time = time - start_time\n if wait_time > k:\n if t:\n new_bus = True\n continue\n else:\n bus += 1\n break\n\n t.pop(0)\n capacity += 1\n\n if capacity == c:\n new_bus = True\n continue\n\nprint(bus)\n']
['Wrong Answer', 'Accepted']
['s402793310', 's422572404']
[7384.0, 7384.0]
[1775.0, 1782.0]
[553, 559]
p03785
u388415336
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['passengers, bus_size, time_lim = map(int, input().split())\npass_list = [int(input()) for passenger in range(passengers)]\npass_list.sort()\nfront = 0\nnow = 0\ncnt = 0\nans = 0\nfor psngr_lst in pass_list:\n if cnt == 0:\n front = i\n now = i\n cnt += 1\n elif cnt == bus_size:\n front = i\n now = i\n cnt = 1\n ans += 1\n elif now - front <= time_lim:\n if i - front <= time_lim:\n now = i\n cnt += 1\n else:\n front = i\n now = i\n cnt = 1\n ans += 1\nif cnt:\n ans += 1\nprint(ans)\n ', 'passengers, bus_size, time_lim = map(int, input().split())\npass_list = [int(input()) for passenger in range(passengers)]\npass_list.sort()\nfront = 0\nnow = 0\ncnt = 0\nans = 0\nfor psngr_lst in pass_list:\n if cnt == 0:\n front = psngr_lst\n now = psngr_lst\n cnt += 1\n elif cnt == bus_size:\n front = psngr_lst\n now = psngr_lst\n cnt = 1\n ans += 1\n elif now - front <= time_lim:\n if psngr_lst - front <= time_lim:\n now = psngr_lst\n cnt += 1\n else:\n front = psngr_lst\n now = psngr_lst\n cnt = 1\n ans += 1\nif cnt:\n ans += 1\nprint(ans)\n ']
['Runtime Error', 'Accepted']
['s080576440', 's340307236']
[7444.0, 7384.0]
[200.0, 252.0]
[607, 671]
p03785
u394244719
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['import sys\n\n\ninint = lambda: int(sys.stdin.readline())\ninintm = lambda: map(int, sys.stdin.readline().split())\ninintl = lambda: list(inintm())\ninstrm = lambda: map(str, sys.stdin.readline().split())\ninstrl = lambda: list(instrm())\n\nn ,c, k = inintm()\n\nT = []\nans = 1\n\nfor _ in range(n):\n T.append(inint())\n\nT.sort()\n\nf = T[0]\ncnt = 1\n\nfor i in range(1,n):\n c += 1\n if T[i] - f <= k and cnt < c:\n continue\n else:\n f = T[i]\n ans += 1\n cnt = 1\n\nprint(ans)', 'import sys\n\n\ninint = lambda: int(sys.stdin.readline())\ninintm = lambda: map(int, sys.stdin.readline().split())\ninintl = lambda: list(inintm())\ninstrm = lambda: map(str, sys.stdin.readline().split())\ninstrl = lambda: list(instrm())\n\nn ,c, k = inintm()\n\nT = []\nans = 1\n\nfor _ in range(n):\n T.append(inint())\n\nT.sort()\n\nf = T[0]\ncnt = 1\n\nfor i in range(1,n):\n c += 1\n if T[i] - f <= k and cnt <= c:\n continue\n else:\n f = T[i]\n ans += 1\n cnt = 1\n\nprint(ans)', 'import sys\n\n\ninint = lambda: int(sys.stdin.readline())\ninintm = lambda: map(int, sys.stdin.readline().split())\ninintl = lambda: list(inintm())\ninstrm = lambda: map(str, sys.stdin.readline().split())\ninstrl = lambda: list(instrm())\n\nn ,c, k = inintm()\n\nT = []\nans = 1\n\nfor _ in range(n):\n T.append(inint())\n\nT.sort()\n\nf = T[0]\ncnt = 0\n\nfor i in range(1,n):\n if T[i] - f < k and cnt <= c:\n continue\n else:\n f = T[i]\n ans += 1\n\nprint(ans)\nprint(T)', 'import sys\n\n\ninint = lambda: int(sys.stdin.readline())\ninintm = lambda: map(int, sys.stdin.readline().split())\ninintl = lambda: list(inintm())\ninstrm = lambda: map(str, sys.stdin.readline().split())\ninstrl = lambda: list(instrm())\n\nn ,c, k = inintm()\n\nT = []\nans = 1\n\nfor _ in range(n):\n T.append(inint())\n\nT.sort()\n\nf = T[0]\ncnt = 1\n\nfor i in range(1,n):\n cnt += 1\n if T[i] - f <= k and cnt <= c:\n continue\n else:\n f = T[i]\n ans += 1\n cnt = 1\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s462525136', 's596751625', 's821950667', 's817044351']
[13240.0, 13260.0, 15288.0, 13328.0]
[115.0, 113.0, 113.0, 116.0]
[492, 493, 474, 495]
p03785
u397531548
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K=map(int,input().split())\nA=[]\nfor i in range(N):\n a=int(input())\n A.append(a)\nA.sort()\nk=K\na=0\nc=C\nj=1\nwhile j<N:\n k-=A[j]-A[j-1]\n n-=1\n if k>0 and c>0: \n j+=1\n else: \n a+=1\n c=C\n k=K\n j+=1\nprint(a+1) ', 'N,C,K=map(int,input().split())\nA=[]\nfor i in range(N):\n a=int(input())\n A.append(a)\nA.sort()\nk=K\na=0\nc=C\nj=1\nwhile j<N:\n k-=A[j]-A[j-1]\n n-=1\n if k>0 and c>0: \n j+=1\n else: \n a+=1\n c=C\n k=K\n j+=1\nprint(a+1) ', 'N,C,K=map(int,input().split())\nA=[]\nfor i in range(N):\n a=int(input())\n A.append(a)\nA.sort()\nk=K\na=0\nc=C\nj=1\nwhile j<N:\n k-=A[j]-A[j-1]\n c-=1\n if k>=0 and c>=0: \n j+=1\n else: \n a+=1\n c=C\n k=K\n j+=1\nprint(a+1) ', 'N,C,K=map(int,input().split())\nA=[]\nfor i in range(N):\n a=int(input())\n A.append(a)\nA.sort()\nk=K\na=0\nc=C-1\nj=1\nwhile j<N:\n k-=A[j]-A[j-1]\n c-=1\n if k>=0 and c>=0: \n j+=1\n else: \n a+=1\n c=C-1\n k=K\n j+=1\nprint(a+1) ']
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s150283470', 's394766750', 's403209926', 's695308122']
[7392.0, 7488.0, 7484.0, 7384.0]
[220.0, 221.0, 289.0, 288.0]
[269, 269, 271, 275]
p03785
u404676457
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\nt.sort()\nf = 0\ncount = 0\nfor i in range(1, n):\n if t[i] > t[f] + k:\n count += 1\n f = i\nelse:\n count += 1\nprint(count)', 'n, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\nt.sort()\nf = 0\ncount = 0\nfor i in range(1, n):\n if t[i] > t[f] + k or c == i - f:\n count += 1\n f = i\nelse:\n count += 1\nprint(count)']
['Wrong Answer', 'Accepted']
['s689597957', 's616442024']
[7384.0, 7384.0]
[239.0, 249.0]
[210, 224]
p03785
u405660020
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int, input().split())\nt=[int(input()) for _ in range(n)]\nt.sort()\ntmp_lim=t[0]+k\nnum_bus=0\nnum_person=1\nfor i in range(1, n):\n if tmp_lim<t[i] or c<=num_person:\n num_bus+=1\n tmp_lim=t[i]+k\n num_person=1\n else:\n num_person+=1\n print(num_bus, num_person, tmp_lim)\nprint(num_bus+1)\n', 'n,c,k=map(int, input().split())\nt=[int(input()) for _ in range(n)]\nt.sort()\ntmp_lim=t[0]+k\nnum_bus=0\nnum_person=1\nfor i in range(1, n):\n if tmp_lim<t[i] or c<=num_person:\n num_bus+=1\n tmp_lim=t[i]+k\n num_person=1\n else:\n num_person+=1\n # print(num_bus, num_person, tmp_lim)\nprint(num_bus+1)']
['Wrong Answer', 'Accepted']
['s229919229', 's249053960']
[13176.0, 13328.0]
[250.0, 188.0]
[326, 327]
p03785
u421499233
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int,input().split())\nT = [int(input()) for i in range(N)]\n# print(T)\nT.sort()\n# print(T)\ntime = T[0]\npeople = 0\nbus = 1\nfor i in T:\n people += 1 \n if i - time > K or people > K: \n bus += 1 \n time = i\n people = 1 \nprint(bus)', 'N, C, K = map(int,input().split())\nT = [int(input()) for i in range(N)]\n# print(T)\nT.sort()\n# print(T)\ntime = T[0]\npeople = 0\nbus = 1\nfor i in T:\n people += 1 \n if i - time > K or people > C: \n bus += 1 \n time = i\n people = 1 \nprint(bus)']
['Wrong Answer', 'Accepted']
['s845557962', 's687338655']
[7384.0, 7384.0]
[235.0, 229.0]
[352, 352]
p03785
u426108351
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\nt.sort()\nperson = 0\nfirsttime = 0\nans = 0\nfor i in range(n):\n if person == 0:\n firsttime = t[i]\n person += 1\n elif person <= c-1 and (firsttime + k) <= t[i]:\n person += 1\n else:\n person = 1\n firsttime = t[i]\n ans += 1\n \nif person != 0:\n ans += 1\nprint(ans)\n \n \n \n \n', 'n, c, k = map(int, input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\nt.sort()\nperson = 0\nfirsttime = 0\nans = 0\nfor i in range(n):\n if person == 0:\n firsttime = t[i]\n person += 1\n elif person <= c-1 and (firsttime + k) >= t[i]:\n person += 1\n else:\n person = 1\n firsttime = t[i]\n ans += 1\n \nif person != 0:\n ans += 1\nprint(ans)\n \n \n \n \n']
['Wrong Answer', 'Accepted']
['s635794373', 's903857324']
[7384.0, 7384.0]
[253.0, 262.0]
[390, 390]
p03785
u426764965
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().split())\nT = [0] * N\nfor i in range(N):\n T[i] = int(input())\nT = sorted(T)\nans = 0\nwaiting = []\nfor t in T:\n if len(waiting) == C:\n ans += 1\n waiting = []\n elif len(waiting) > 0 and t > waiting[0] + K:\n ans += 1\n waiting = []\n else:\n waiting.append(t)\nelse:\n ans += 1\nprint(ans)', 'N, C, K = map(int, input().split())\nT = [0] * N\nfor i in range(N):\n T[i] = int(input())\nT = sorted(T)\nans = 0\nwaiting = []\nfor t in T:\n if len(waiting) == C:\n ans += 1\n waiting = []\n if len(waiting) > 0 and t > waiting[0] + K:\n ans += 1\n waiting = []\n waiting.append(t)\nelse:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s077537830', 's534338592']
[8240.0, 8240.0]
[255.0, 273.0]
[325, 313]
p03785
u431981421
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K = map(int,input().split())\nli = []\nfor t in range(N):\n li.append(int(input()))\n\ncount = 0\nans = 0\n\nnewLi = sorted(li)\n\nwhile(len(newLi)):\n for c in range(C - 1):\n if len(newLi) < 2:\n\t break\n \n if newLi[1] <= newLi[0] + K:\n newLi.pop(1)\n else:\n break\n\n newLi.pop(0)\n ans += 1\n\nprint(ans)', 'N,C,K = map(int,input().split())\nli = []\nfor t in range(N):\n li.append(int(input()))\n\ncount = 0\nans = 0\n\nnewLi = sorted(li)\n\nwhile(len(newLi)):\n for c in range(C - 1):\n if len(newLi) < 2:\n break\n \n if newLi[1] <= newLi[0] + K:\n newLi.pop(1)\n else:\n break\n\n newLi.pop(0)\n ans += 1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s079523058', 's221406110']
[2940.0, 8280.0]
[17.0, 1792.0]
[319, 322]
p03785
u434208140
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int,input().split())\nt=[int(input()) for _ in [0]*n]\nt.sort()\nt=t+[0]\nb=1\nh=0\nd=t[0]\nfor i in range(n):\n if(h<=c and t[i]-d<=k):\n h+=1\n else:\n b+=1\n h=1\n d=t[i+1]\nprint(b)', 'n,c,k=map(int,input().split())\nt=[int(input()) for _ in [0]*n]\nt.sort()\nt=t+[0]\nb=1\nh=0\nd=t[0]\nfor i in range(n):\n if(h<c and t[i]-d<=k):\n h+=1\n else:\n b+=1\n h=1\n d=t[i+1]\nprint(b)', 'n,c,k=map(int,input().split())\nt=[int(input()) for _ in [0]*n]\nt.sort()\nb=1\nh=0\nd=t[0]\nfor i in range(n):\n if(h<c and t[i]-d<=k):\n h+=1\n else:\n b+=1\n h=1\n d=t[i]\nprint(b)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s205600794', 's813718277', 's714458696']
[7840.0, 7840.0, 7840.0]
[230.0, 230.0, 238.0]
[195, 194, 184]
p03785
u464205401
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt = [int(input()) for _ in range(n)]\nt.sort()\ncnt = 0\nans = 0\nend = -1\nfor i,t in enumerate(t):\n if end <= t:\n cnt = 1\n ans +=1\n end = t+k\n else:\n cnt +=1\n if cnt > c:\n cnt = 1\n ans +=1\n end = t+k\n print("i",i,"t",t,"cnt",cnt,"ans",ans,"end",end)\nprint(ans)', 'n,c,k = map(int,input().split())\n\nt_tmp = 10**9+1\ncnt = 0 \nbuses = 0 \nfor i in range(n):\n t = int(input())\n cnt +=1\n if t >= t_tmp+k or cnt >= c:\n buses += -(-cnt//c)\n cnt = 0\n t_tmp = t\n t_tmp = min(t_tmp,t)\n# print(i,t,t_tmp+k,cnt,buses)\nbuses += -(-cnt//c)\nprint(buses)', 'n,c,k = map(int,input().split())\nt = [int(input()) for _ in range(n)]\nt.sort()\ncnt = 0\nans = 0\nend = -1\nfor i,t in enumerate(t):\n if end < t:\n cnt = 1\n ans +=1\n end = t+k\n else:\n cnt +=1\n if cnt > c:\n cnt = 1\n ans +=1\n end = t+k\n# print("i",i,"t",t,"cnt",cnt,"ans",ans,"end",end)\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s278093392', 's823050412', 's010626781']
[13416.0, 9200.0, 13268.0]
[387.0, 188.0, 177.0]
[315, 286, 315]
p03785
u475675023
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k,*t=map(int,open(0).read().split())\nt=sorted(t)\ncnt,ans=0,1\nx=t[0]\nfor i in range(n):\n cnt+=1\n if t[i]-x<k or cnt>c:\n x=t[i]\n ans+=1\n cnt=1\nprint(ans)', 'n,c,k,*t=map(int,open(0).read().split())\nt=sorted(t)\ncnt=0\nans=1\nx=t[0]\nfor i in range(n):\n cnt+=1\n if t[i]-x>k or cnt>c:\n x=t[i]\n ans+=1\n cnt=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s841220766', 's983412542']
[14052.0, 14052.0]
[121.0, 119.0]
[166, 166]
p03785
u487594898
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['input = sys.stdin.readline\nn,c,k = map(int,input().split())\nA = [int(input()) for i in range(n)]\na = sorted(A)\nans = 0\ntime = 0.1 \nnum = 0\nfor i in range(n):\n if ans == 0:\n ans +=1\n time = a[0] -0.1\n num +=1\n elif ans != 0 and a[i] < time +k and num < c :\n num +=1\n elif ans != 0 and (c <=num or time +k <=a[i]):\n \n time = a[i] -0.1\n num = 1\n ans +=1\nprint(ans)', '#!/usr/bin/env python3\n# sys.stdin.readline()\nimport numpy as np\nimport sys\nimport math\ninput = sys.stdin.readline\nn,c,k = map(int,input().split())\nA = [int(input()) for i in range(n)]\na = sorted(A)\nans = 0\ntime = 0.1 \nnum = 0\nfor i in range(n):\n if ans == 0:\n ans +=1\n time = a[0] \n num +=1\n elif ans != 0 and a[i] <= time +k and num < c :\n num +=1\n elif ans != 0 and (c <=num or time +k <=a[i]):\n \n time = a[i] \n num = 1\n ans +=1\nprint(ans)']
['Runtime Error', 'Accepted']
['s872984921', 's279504261']
[3064.0, 17528.0]
[18.0, 277.0]
[427, 508]
p03785
u496821919
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K = map(int,input().split())\nT =[int(input()) for i in range(N)]\n\np = 0\nr = 0\ncnt = 1\n\nT.sort()\n\nfor i in range(len(T)):\n if p == 0:\n p = 1\n q = T[i]\n r = 1\n elif p == 1 and q + K >= T[i] and r <= C:\n r += 1\n else:\n cnt += 1\n p = 1\n q = T[i]\n r = 1\n\nprint(cnt)\n', 'N,C,K = map(int,input().split())\nT =[int(input()) for i in range(N)]\n\np = 0\nr = 0\ncnt = 1\n\nT.sort()\n\nfor i in range(len(T)):\n if p == 0:\n p = 1\n q = T[i]\n r = 1\n elif p == 1 and q + K >= T[i] and r < C:\n r += 1\n else:\n cnt += 1\n p = 1\n q = T[i]\n r = 1\n\nprint(cnt)\n']
['Wrong Answer', 'Accepted']
['s353630944', 's130511862']
[7532.0, 7420.0]
[266.0, 256.0]
[330, 329]
p03785
u497952650
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K = map(int,input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nbus = 1\nbus_time = 0\ntmp_bus = 0\nflag = False\n\nfor i in range(N):\n \n t = T[i]\n\n if not flag:\n bus_time = t + K\n tmp_bus = 1\n flag = True\n\n else:\n if t <= bus_time:\n tmp_bus += 1\n if tmp_bus == C or i == N-1:\n bus += 1\n flag = False\n\n else:\n bus += 1\n bus_time = t + K\n tmp_bus = 1\n print(t,bus,tmp_bus,bus_time)\n\nprint(bus)', 'N,C,K = map(int,input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nbus = 1\ntmp_bus = 1\nbus_time = T[0] + K\n\nfor t in T[1:]:\n\n if tmp_bus < C and t <= bus_time:\n tmp_bus += 1\n else:\n bus += 1\n bus_time = t + K\n tmp_bus = 1\n\nprint(bus)']
['Wrong Answer', 'Accepted']
['s284034061', 's430173056']
[10044.0, 8276.0]
[466.0, 259.0]
[554, 279]
p03785
u501643136
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int,input().split())\nT = []\nfor _ in range(N):\n T.append(int(input()))\nsorted(T)\ncnt=1\ns=0\nfor i in range(N):\n if (T[i] > T[s]+K) or (i==s+C):\n cnt += 0\n s=i\nprint(cnt)\n', 'N, C, K = map(int,input().split())\nT = []\nfor _ in range(N):\n T.append(int(input()))\nT.sort()\ncnt=1\ns=0\nfor i in range(1,N):\n if (T[i] > T[s]+K) or (i==s+C):\n cnt += 1\n s=i\nprint(cnt)']
['Wrong Answer', 'Accepted']
['s905811585', 's369102112']
[8280.0, 7384.0]
[249.0, 260.0]
[191, 191]
p03785
u502731482
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\n\nt = [0] * n\nfor i in range(n):\n t[i] = int(input())\nt = sorted(t)\nans = 0\ni = 0\nwhile i < n:\n j = 0\n while i + j < n and t[i + j] < t[i] + k and j < c:\n j += 1\n i += j\n ans += 1 \nprint(t, ans)\n', 'n, c, k = map(int, input().split())\n\nt = [0] * n\nfor i in range(n):\n t[i] = int(input())\nt = sorted(t)\nans = 0\ni = 0\nwhile i < n:\n j = 1\n while i + j < n and t[i + j] < t[i] + k and j < c:\n j += 1\n i += j\n ans += 1 \nprint(t, ans)\n', 'n, c, k = map(int, input().split())\n\nt = [0] * n\nfor i in range(n):\n t[i] = int(input())\nt = sorted(t)\nans = 0\ni = 0\nwhile i < n:\n j = 1\n while i + j < n and t[i + j] <= t[i] + k and j < c:\n j += 1\n i += j\n ans += 1 \nprint(ans)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s475505922', 's489877086', 's434706168']
[11028.0, 11028.0, 8240.0]
[315.0, 289.0, 267.0]
[252, 252, 250]
p03785
u514401521
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().split())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nT.sort()\ni = 0\nstart = 0\nans = 0\nlimit = C\nfor i in range(N):\n if T[start] + K >= T[i + 1] and limit > 1 :\n limit -= 1\n elif T[start] + K < T[i + 1] and limit > 1:\n ans += 1\n limit = C\n start = i + 1\n elif T[start] + K >= T[i + 1] and limit == 1:\n ans += 1\n limit = C\n start = i + 1\nif start != N:\n ans += 1\nprint(ans)', 'N, C, K = map(int, input().split())\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nT.sort()\ni = 0\nstart = 0\nans = 0\nlimit = C\nfor i in range(N - 1):\n \n if T[start] + K >= T[i + 1] and limit > 1 :\n limit -= 1\n \n elif T[start] + K < T[i + 1] and limit > 1:\n ans += 1\n limit = C\n start = i + 1\n \n elif limit == 1:\n ans += 1\n limit = C\n start = i + 1\n\nans += 1\nprint(ans)']
['Runtime Error', 'Accepted']
['s370415331', 's870143809']
[7392.0, 7484.0]
[289.0, 274.0]
[469, 763]
p03785
u532966492
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K=map(int,input().split())\nT=[int(input()) for _ in range(N)]\nflag=0\nbus_cnt=0\nFirst=T[i]\nbus_rider=1\nbus_cnt=1\nfor i in range(N):\n if bus_rider<C and T[i]-First<=K:\n bus_rider+=1\n else:\n First=T[i]\n bus_rider=1\n bus_cnt+=1\nprint(bus_cnt)', 'N,C,K=map(int,input().split())\nT=sorted([int(input()) for _ in range(N)])\nFirst=T[0]\nbus_rider=1\nbus_cnt=1\nfor i in range(1,N):\n if bus_rider<C and T[i]-First<=K:\n bus_rider+=1\n else:\n First=T[i]\n bus_rider=1\n bus_cnt+=1\nprint(bus_cnt)']
['Runtime Error', 'Accepted']
['s586338685', 's639029481']
[7072.0, 8276.0]
[170.0, 235.0]
[276, 269]
p03785
u535171899
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt_input = [int(input()) for i in range(n)]\n\nt_s = sorted(t_input)\n\nans = 0\nc_limit = 1\nt_limit = t_s[0]*k\nfor i in range(n):\n t = t_input[i]\n \n if t>t_limit or c>=c_limit:\n ans+=1\n c_limit=1\n t_limit = t+k\n else:\n c_limit+=1\nprint(ans)', 'n,c,k = map(int,input().split())\nt_input = [int(input()) for i in range(n)]\n\nt_s = sorted(t_input)\n\nans = 1\nc_limit = 1\nt_limit = t_s[0]+k\nfor i in range(1,n):\n t = t_s[i]\n \n if t>t_limit or c_limit>=c:\n ans+=1\n c_limit=1\n t_limit = t+k\n else:\n c_limit+=1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s376257581', 's458552064']
[8276.0, 8276.0]
[254.0, 248.0]
[399, 397]
p03785
u536034761
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['from collections import deque\nN, C, K = map(int, input().split())\nT = [int(input()) for _ in range(N)]\nD = deque(sorted(T))\ncnt = 2\nans = 0\npre = D.popleft()\nflag = False\nwhile D:\n if cnt == C:\n cnt = 2\n pre = D.popleft()\n ans += 1\n flag = False\n else:\n d = D.popleft()\n cnt += 1\n flag = True\n if d - pre > K:\n cnt = 2\n pre = d\n ans += 1\n flag = False\nif flag:\n ans += 1\nprint(ans)', 'from collections import deque\nN, C, K = map(int, input().split())\nT = [int(input()) for _ in range(N)]\nD = deque(sorted(T))\ncnt = 1\nans = 1\npre = D.popleft()\nflag = False\nwhile D:\n d = D.popleft()\n cnt += 1\n if cnt > C or d - pre > K:\n cnt = 1\n pre = d\n ans += 1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s637618340', 's636385144']
[14604.0, 14596.0]
[193.0, 191.0]
[490, 304]
p03785
u540761833
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K = map(int,input().split())\nT = []\nfor i in range(N):\n T.append(int(input()))\nT.sort()\ncount = 0\ntime = T[0] + K\nppl = 1\nfor i in range(1,N):\n flag = True\n ppl += 1\n if T[i] > time:\n count += 1\n time = T[i]+K\n ppl = 1\n flag = False\n if ppl == C:\n count += 1\n if i != N-1:\n time = T[i+1]+K\n ppl = 0\n flag = False\n if i == N-1 and flag:\n count += 1\nprint(count)', 'N,C,K = map(int,input().split())\nT = sorted([int(input()) for i in range(N)],reverse=1)\ncount = 0\nbus = 0\narr = T[0] -K\nfor i in range(N):\n if arr <= T[i]:\n count += 1\n else:\n count = 1\n arr = T[i] - K\n bus += 1\n\n if count == C:\n bus += 1\n count = 0\n if i != N-1:\n arr = T[i+1]-K \nif count:\n bus += 1\nprint(bus)']
['Wrong Answer', 'Accepted']
['s477202516', 's198892193']
[7508.0, 8276.0]
[285.0, 255.0]
[456, 383]
p03785
u541610817
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = [int(x) for x in input().split()]\nT_lst = [int(input()) for i in range(N)]\nT_lst.sort()\n\nbus = 1\nst = T_lst[0]\nnum = 1\nfor i in range(1, N):\n if T_lst[i] <= st + K and num <= C:\n num += 1\n continue\n else:\n st = T_lst[i]\n bus += 1\n num = 0\nprint(bus)\n', 'N, C, K = [int(x) for x in input().split()]\nT_lst = [int(input()) for i in range(N)]\nT_lst.sort()\n\nbus = 1\nst = T_lst[0]\nnum = 1\nfor i in range(1, N):\n if T_lst[i] <= st + K and num < C:\n num += 1\n else:\n bus += 1\n st = T_lst[i]\n num = 1\nprint(bus)\n']
['Wrong Answer', 'Accepted']
['s504984931', 's266049230']
[7444.0, 7384.0]
[244.0, 239.0]
[301, 283]
p03785
u545368057
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int, input().split())\nTs = [int(input()) for i in range(n)] + [10**10]\nTs = sorted(Ts)\n\nans = 0\ncnt = 0\nflg = 0\nprev = Ts[0]\nfor i in range(1,len(Ts)):\n now = Ts[i]\n if now - prev <= k:\n cnt += 1\n else:\n ans += 1\n cnt = 1\n prev = Ts[i]\n if cnt > c:\n ans += 1\n cnt = 1\n prev = Ts[i]\n # print("i",i,"cnt",cnt,"ans",ans)\nprint(ans)\n\n', 'n,c,k = map(int, input().split())\nTs = [int(input()) for i in range(n)] + [10**10]\nTs = sorted(Ts)\n\nans = 0\ncnt = 1\nflg = 0\nprev = Ts[0]\nfor i in range(1,len(Ts)):\n now = Ts[i]\n if now - prev <= k:\n cnt += 1\n else:\n ans += 1\n cnt = 1\n prev = Ts[i]\n if cnt > c:\n ans += 1\n cnt = 1\n prev = Ts[i]\n # print("i",i,"cnt",cnt,"ans",ans)\nprint(ans)\n\n']
['Wrong Answer', 'Accepted']
['s989633585', 's567603340']
[8076.0, 8076.0]
[247.0, 242.0]
[406, 406]
p03785
u580697892
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['# coding: utf-8\nfrom math import ceil\nN, C, K = map(int, input().split())\nT = []\nfor _ in range(N):\n t = int(input())\n T.append(t)\nT.sort()\nans = 0\ntime = 0\nl = []\nfor i in range(N):\n l.append(T[i])\n # print(l)\n if len(l) == C:\n ans += 1\n l = []\n elif i < N - 1:\n if T[i+1] - l[-1] > K:\n ans += ceil(len(l[:-1]) / C)\n l = [l[-1]]\n elif l[-1] - l[0] >= K:\n ans += ceil(len(l) / C)\n l = []\nprint(ans + ceil(len(l)/C))', '# coding: utf-8\nN, C, K = map(int, input().split())\nT = []\nfor i in range(N):\n t = int(input())\n T.append(t)\nT.sort()\n# print(T)\nans = 0\nidx = 0\ns = T[0]\ncnt = 1\nfor i in range(1,N):\n if cnt >= C:\n ans += 1\n cnt = 1\n s = T[i]\n else:\n if T[i] - s <= K:\n cnt += 1\n else:\n ans += 1\n cnt = 1\n s = T[i]\nif cnt != 0:\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s395615309', 's932974587']
[7404.0, 7388.0]
[341.0, 254.0]
[505, 425]
p03785
u583826716
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().rstrip().split())\nTT = sorted(map(int, [input() for _ in range(N)]))\nstartT = TT[0]\nbus_count = 1\np = 1\nfor T in TT[1:]:\n if T - startT > K or p > C:\n bus_count += 1\n startT = T\n p = 1\n else:\n p += 1\nprint(bus_count)\n', 'N, C, K = map(int, input().rstrip().split())\nTT = sorted(map(int, [input() for _ in range(N)]))\nstartT = TT[0]\nbus_count = 1\np = 1\nfor T in TT[1:]:\n if T - startT > K or p >= C:\n bus_count += 1\n startT = T\n p = 1\n else:\n p += 1\nprint(bus_count)\n']
['Wrong Answer', 'Accepted']
['s256607097', 's186672908']
[14124.0, 14108.0]
[208.0, 207.0]
[278, 279]
p03785
u591503175
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['def resolve():\n \'\'\'\n code here\n \'\'\'\n N, C, K = [int(item) for item in input().split()]\n Ts = [int(input()) for _ in range(N)]\n Ts.sort()\n\n res = 0\n temp_psg = 0\n lim = Ts[0] + K\n\n for i in range(N):\n temp_psg += 1\n if Ts[i] > lim:\n res += 1\n temp_psg = 1\n lim = Ts[i] + K\n else:\n if temp_psg == C:\n res += 1\n temp_psg = 1\n lim = Ts[i] + K\n # print(Ts[i], temp_psg, res, lim)\n print(res)\n\n\nif __name__ == "__main__":\n resolve()\n', 'def resolve():\n \'\'\'\n code here\n \'\'\'\n N, C, K = [int(item) for item in input().split()]\n Ts = [int(input()) for _ in range(N)]\n Ts.sort()\n\n res = 0\n temp_psg = 0\n lim = Ts[0] + K\n\n for i in range(N):\n temp_psg += 1\n if Ts[i] > lim:\n res += 1\n temp_psg = 1\n lim = Ts[i] + K\n else:\n if temp_psg == C and i < N-1:\n res += 1\n temp_psg = 0\n lim = Ts[i+1] + K\n # print(Ts[i], temp_psg, res, lim)\n \n if temp_psg > 0:\n res += 1\n print(res)\n\n\nif __name__ == "__main__":\n resolve()\n']
['Wrong Answer', 'Accepted']
['s456858027', 's684514463']
[13256.0, 13376.0]
[170.0, 173.0]
[580, 637]
p03785
u623231048
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\n\nt.sort()\n\nans = 0\ncnt = 0\ntmp = 0\ns = t[0]\n\nwhile tmp < n:\n t1 = t[tmp]\n tmp += 1\n cnt += 1\n if cnt == c:\n ans += 1\n cnt = 0\n if tmp < n:\n s = t[tmp]\n else:\n print(ans)\n exit()\n elif t1 - s > k:\n if tmp < n:\n ans += 1\n cnt = 0\n s = t[tmp-1]\n else:\n print(ans)\n exit()\n\nprint(ans+1)\n', 'n,c,k = map(int,input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\n\nt.sort()\n\nans = 0\ncnt = 0\ntmp = 0\ns = t[0]\n\nwhile tmp < n:\n t1 = t[tmp]\n cnt += 1\n if t1 - s > k:\n ans += 1\n cnt = 1\n s = t[tmp]\n elif cnt == c:\n if tmp < n - 1:\n s = t[tmp + 1]\n ans += 1\n cnt = 0\n\n tmp += 1\n\nif cnt > 0:\n ans += 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s460882772', 's303253826']
[13240.0, 13280.0]
[206.0, 207.0]
[514, 409]
p03785
u623819879
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n t.append(int(input()))\nt.sort(reverse=True)\n\nbus=0\narr=0\nque=0\nfor i in range(n):\n tt=t[i]\n if que==0:\n arr=tt\n que+=1\n else:\n if que==c:\n bus+=1\n arr=tt\n que=1\n else:\n if arr+k>tt:\n bus+=1\n arr=tt\n que=1\n else:\n que+=1\nprint(bus)', "n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n t.append(int(input()))\nt.sort()\n\nbus=0\narr=0\nque=0\nfor i in range(n):\n tt=t[i]\n if que==0:\n print('que=0,i,bus,arr,que,t[i]',i,bus,arr,que,t[i])\n arr=tt\n que+=1\n bus+=1\n else:\n if que==c:\n #print('q==c,i,bus,arr,que,t[i]',i,bus,arr,que,t[i])\n bus+=1\n arr=tt\n que=1\n else:\n if arr+k<tt:\n #print('dep,i,bus,arr,que,t[i]',i,bus,arr,que,t[i])\n bus+=1\n arr=tt\n que=1\n else:\n \n que+=1\n\nprint(bus)", 'n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n t.append(int(input()))\nt.sort(reverse=True)\n\nbus=0\narr=0\nque=0\nfor i in range(n):\n tt=t[i]\n if que==0:\n arr=tt\n que+=1\n else:\n if que==c:\n bus+=1\n arr=tt\n que=0\n else:\n if arr+k>tt:\n bus+=1\n arr=tt\n que=0\nprint(bus)', 'n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n t.append(int(input()))\nt.sort(reverse=True)\n\nbus=0\narr=0\nque=0\nfor i in range(n):\n tt=t[i]\n if que==0:\n arr=tt\n que+=1\n else:\n if arr+k>tt:\n bus+=1\n arr=tt\n que=0\nprint(bus)', 'n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n t.append(int(input()))\nt.sort(reverse=True)\n\nbus=0\narr=0\nque=0\nfor i in range(n):\n tt=t[i]\n if que==0:\n arr=tt\n que+=1\n else:\n if que==c:\n bus+=1\n arr=tt\n que=1\n else:\n if arr+k>tt:\n bus+=1\n arr=tt\n que=1\nprint(bus)', "n,c,k=map(int,input().split())\nt=[]\nfor i in range(n):\n t.append(int(input()))\nt.sort()\n\nbus=0\narr=0\nque=0\nfor i in range(n):\n tt=t[i]\n if que==0:\n #print('que=0,i,bus,arr,que,t[i]',i,bus,arr,que,t[i])\n arr=tt\n que+=1\n bus+=1\n else:\n if que==c:\n #print('q==c,i,bus,arr,que,t[i]',i,bus,arr,que,t[i])\n bus+=1\n arr=tt\n que=1\n else:\n if arr+k<tt:\n #print('dep,i,bus,arr,que,t[i]',i,bus,arr,que,t[i])\n bus+=1\n arr=tt\n que=1\n else:\n \n que+=1\n\nprint(bus)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s028698091', 's511376251', 's607104621', 's903921836', 's993894642', 's047379807']
[7388.0, 7504.0, 7392.0, 7388.0, 7384.0, 7484.0]
[262.0, 268.0, 259.0, 253.0, 254.0, 258.0]
[355, 595, 328, 257, 328, 596]
p03785
u626468554
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['#n = int(input())\n#n,k = map(int,input().split())\n#x = list(map(int,input().split()))\n\nN,C,K = map(int,input().split())\nT = [int(input()) for _ in range(N)]\nT.sort()\nT.append(T[-1])\n\nfst = T[0]\ncnt = 1\nans = 0\nflg = 0\n\nfor i in range(1,N):\n cnt += 1\n flg = 0\n if T[i]-fst > K:\n fst = T[i]\n cnt = 1\n ans += 1\n \n elif cnt == C:\n fst = T[i+1]\n cnt = 0\n ans += 1\n flg = 1\n\n\n # print(i,T[i],flg,fst,ans,cnt)\n\nif not(flg):\n ans += 1\n\nprint(ans+1)\n \n \n\n\n', '#n = int(input())\n#n,k = map(int,input().split())\n#x = list(map(int,input().split()))\n\nN,C,K = map(int,input().split())\nT = [int(input()) for _ in range(N)]\nT.sort()\nT.append(T[-1])\n\nfst = T[0]\ncnt = 0\nans = 0\nflg = 0\n\nfor i in range(N):\n cnt += 1\n flg = 0\n if T[i]-fst > K:\n fst = T[i]\n cnt = 1\n ans += 1\n \n elif cnt == C:\n fst = T[i+1]\n cnt = 0\n ans += 1\n flg = 1\n\n\n print(i,T[i],flg,fst,ans,cnt)\n\nif not(flg):\n ans += 1\n\nprint(ans)\n \n \n\n\n', '#n = int(input())\n#n,k = map(int,input().split())\n#x = list(map(int,input().split()))\n\nN,C,K = map(int,input().split())\nT = [int(input()) for _ in range(N)]\nT.sort()\nT.append(T[-1])\n\nfst = T[0]\ncnt = 1\nans = 0\nflg = 0\n\nfor i in range(1,N):\n cnt += 1\n flg = 0\n if T[i]-fst > K:\n fst = T[i]\n cnt = 1\n ans += 1\n \n elif cnt == C:\n fst = T[i+1]\n cnt = 0\n ans += 1\n flg = 1\n\n\n # print(i,T[i],flg,fst,ans,cnt)\n\nif not(flg):\n ans += 1\n\nprint(ans-1)\n \n \n\n\n', '#n = int(input())\n#n,k = map(int,input().split())\n#x = list(map(int,input().split()))\n\nN,C,K = map(int,input().split())\nT = [int(input()) for _ in range(N)]\nT.sort()\nT.append(T[-1])\n\nfst = T[0]\ncnt = 0\nans = 0\nflg = 0\n\nfor i in range(N):\n cnt += 1\n flg = 0\n if T[i]-fst > K:\n fst = T[i]\n cnt = 1\n ans += 1\n \n elif cnt == C:\n fst = T[i+1]\n cnt = 0\n ans += 1\n flg = 1\n\n\n # print(i,T[i],flg,fst,ans,cnt)\n\nif not(flg):\n ans += 1\n\nprint(ans)\n \n \n\n\n']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s360404282', 's680208416', 's794773637', 's818348808']
[7416.0, 10824.0, 7420.0, 7420.0]
[263.0, 564.0, 244.0, 256.0]
[531, 525, 531, 527]
p03785
u629350026
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int,input().split())\nt=[0]*n\nfor i in range(n):\n t[i]=int(input())\nt.sort()\nans=1\ntemp=t[0]\ntempc=1\nfor i in range(1,n):\n if temp+k>=t[i] or tempc>c:\n ans=ans+1\n temp=t[i]\n tempc=1\n else:\n tempc=tempc+1\nprint(ans)', 'n,c,k=map(int,input().split())\nt=[0]*n\nfor i in range(n):\n t[i]=int(input())\nt.sort()\nans=1\ntemp=t[0]\ntempc=1\nfor i in range(1,n):\n if temp+k<t[i] or tempc>=c:\n ans=ans+1\n temp=t[i]\n tempc=1\n else:\n tempc=tempc+1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s420595199', 's933103461']
[7472.0, 7344.0]
[245.0, 250.0]
[238, 238]
p03785
u644360640
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt = [int(input()) for i in range(n)]\n\nt.sort()\nkey = t[0]+k\nlen_t = 0\nans1 = 0\nfor i in range(n):\n if t[i] <= key and len_t < c:\n print(len_t)\n len_t += 1\n else:\n ans1 += 1\n key = t[i]+k\n len_t = 1\nans1 += 1\nprint(ans1)', 'n,c,k = map(int,input().split())\nt = [int(input()) for i in range(n)]\n\nt.sort()\nkey = t[0]+k\nlen_t = 0\nans1 = 0\nfor i in range(n):\n if t[i] <= key and len_t < c:\n len_t += 1\n else:\n ans1 += 1\n key = t[i]+k\n len_t = 1\nans1 += 1\nprint(ans1)']
['Wrong Answer', 'Accepted']
['s658080559', 's756363763']
[7812.0, 7484.0]
[288.0, 242.0]
[293, 272]
p03785
u653485478
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nt = [int(input()) for i in range(n)]\n\nt.sort()\npassenger = 0\ncun = t[0]\nans = 1\n\n\nfor i in t:\n if i - cun > k or passenger == c: #bus go\n ans += 1\n passenger = 0\n elif i - cun <= k and passenger != c:\n passenger += 1\n cun = i\n\n\nif passenger == 0:\n ans -= 1\n \nprint(ans)\n', 'n, c, k = map(int, input().split())\nt = [int(input()) for i in range(n)]\n\nt.sort()\npassenger = 0\nstart = t[0]\nans = 1\n\n\nfor i in t:\n if i - start > k or passenger == c:\n ans += 1\n passenger = 1\n start = i\n else:\n passenger += 1\n\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s180671313', 's471097349']
[7384.0, 7384.0]
[256.0, 226.0]
[342, 275]
p03785
u667024514
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nlis = []\nfor i in range(n):lis.append(int(input()))\nlis.sort()\nans = 0\ntime = 0\ncou = 0\nfor m in range(n):\n if time == 0:\n time = lis[m]\n cou += 1\n elif lis[m] <= time + k and cou < c:\n cou += 1\n else:\n ans += 1\n cou = 1\n time = lis[m]\nprint(lis)', 'n,c,k = map(int,input().split())\nlis = []\nfor i in range(n):lis.append(int(input()))\nlis.sort()\nans = 0\ntime = 0\ncou = 0\nfor m in range(n):\n if time == 0:\n time = lis[m]\n cou += 1\n elif lis[m] <= time + k and cou < c:\n cou += 1\n else:\n ans += 1\n cou = 1\n time = lis[m]\nans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s430772614', 's601473104']
[10568.0, 7388.0]
[260.0, 252.0]
[330, 339]
p03785
u687574784
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['# -*- coding: utf-8 -*-\n\nfrom collections import deque\nn,c,k = list(map(int, input().split()))\nt = deque(sorted([int(input()) for _ in range(n)]))\n\ncnt=0\nbus=[]\nwhile t:\n t1=t.popleft()\n if not bus:\n bus.append(t1)\n elif t1-bus[0]<=k and len(bus)<c:\n bus.append(t1)\n\n if len(bus)>=c:\n cnt+=1\n bus.clear()\n\n if not bus:\n bus.append(t1)\n\nif bus:\n cnt+=1\n \nprint(cnt)', "# -*- coding: utf-8 -*-\n\nfrom collections import deque\nn,c,k = list(map(int, input().split()))\nt = deque(sorted([int(input()) for _ in range(n)]))\n\ncnt=0\nbus=[]\nwhile t:\n flg=False\n t1=t.popleft()\n if not bus:\n bus.append(t1)\n flg=True\n elif t1-bus[0]<=k and len(bus)<c:\n bus.append(t1)\n flg=True\n\n if len(bus)>=c or t1-bus[0]>=k:\n# print('bus=',bus)\n# print('t1=',t1)\n cnt+=1\n bus.clear()\n\n if not flg:\n bus.append(t1)\n\nif bus:\n cnt+=1\n \nprint(cnt)"]
['Wrong Answer', 'Accepted']
['s714385737', 's960142110']
[8508.0, 8588.0]
[296.0, 292.0]
[420, 536]
p03785
u724844363
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['\n\nn, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\nt.sort(reverse=True)\n\nt_b = t[0]\ncnt = 0\nans = 0\n\nfor i in t:\n print(i, t_b, cnt, ans)\n if t_b - i <= k and cnt + 1 <= c: \n cnt += 1\n continue\n else:\n t_b = i\n cnt = 1\n ans += 1\n\nprint(ans + 1)', 'n, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\nt.sort()\n\nt_crr = t[0]\ncnt = 0\nans = 1\n\nfor i in t:\n # print(cnt, ans, t_crr, i)\n if i - t_crr <= k and cnt < c:\n cnt += 1\n continue\n else:\n t_crr = i\n ans += 1\n cnt = 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s308662180', 's366058722']
[9960.0, 7384.0]
[461.0, 229.0]
[354, 298]
p03785
u747703115
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nT = [0]*n\nfor i in range(n):\n T[i] = int(input())\nT.sort()\nans = 0\njk = 0\nt = T[0]\nfor i in range(n):\n if T[i]-t>k:\n ans += 1\n jk = 0\n t = T[i]\n continue\n jk += 1\n if jk==c:\n ans += 1\n jk = 0\n t = T[i]\nprint(ans if jk== else ans+1)', 'n, c, k = map(int, input().split())\nT = [0]*n\nfor i in range(n):\n T[i] = int(input())\nT.sort()\nans = 0\njk = 0\nt = T[0]\nfor i in range(n):\n if T[i]-t>k:\n ans += 1\n jk = 0\n t = T[i]\n continue\n jk += 1\n if jk==c:\n ans += 1\n jk = 0\n t = T[i]\nprint(ans if jk==0 else ans+1)', 'n, c, k = map(int, input().split())\nT = [0]*n\nfor i in range(n):\n T[i] = int(input())\nT.sort()\nT = [0]+T\nmx = 0\njk = 0\nans = 0\nfor i in range(1, n+1):\n mx += T[i]-T[i-1]\n jk += 1\n if jk>=c or mx>k:\n ans += 1\n jk = 0\n mx = 0\nprint(ans if jk==0 else ans+1)', 'n, c, k, *T = map(int, open(0).read().split())\nT.sort()\nans = 1\np = 0\nt = T[0]\nfor i in range(n):\n p += 1\n if T[i]>t+k or p>c:\n t = T[i]\n ans += 1\n p = 1\nprint(ans)']
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s097580406', 's481468969', 's615813617', 's509586973']
[3064.0, 7472.0, 7848.0, 14052.0]
[17.0, 249.0, 266.0, 112.0]
[328, 329, 287, 191]
p03785
u749614185
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['import sys\nN, C, K = map(int, input().split())\nA = list(map(int, sys.stdin.readlines()))+[10**10]\nA.sort()\na, c, t = 0, 1, a[0]+k\nfor i in A[1:]:\n if i <= t and c < C:\n c += 1\n else:\n t, c = i + K, 1\n a += 1\n \nprint(a)', 'import sys\nN, C, K = map(int, input().split())\nA = list(map(int, sys.stdin.readlines()))+[10**10]\nA.sort()\na, c, t = 0, 1, A[0]+K\nfor i in A[1:]:\n if i <= t and c < C:\n c += 1\n else:\n t, c = i + K, 1\n a += 1\n \nprint(a)']
['Runtime Error', 'Accepted']
['s013495275', 's184043358']
[20064.0, 20060.0]
[79.0, 111.0]
[245, 245]
p03785
u751488284
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K=map(int,input().split())\nT=[int(input()) for _ in range(N)]\n\nT.sort()\n\nbus=-10**9\ncnt=0\nans=0\nfor t in T:\n if t>bus or cnt>C:\n bus=t+K\n cnt=1\n ans+=1\n else:\n cnt+=1\n\nprint(ans)', 'N,C,K=map(int,input().split())\nT=[int(input()) for _ in range(N)]\n\nT.sort()\n\nbus=-10**9\ncnt=0\nans=0\nfor t in T:\n if t>bus or cnt>=C:\n bus=t+K\n cnt=1\n ans+=1\n else:\n cnt+=1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s384812768', 's983938595']
[7412.0, 7532.0]
[241.0, 244.0]
[216, 217]
p03785
u757030836
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt = [int(input()) for i in range(n)]\nt.sorted()\n\npas = 1\nlast_bus = t[0] + k\nans = 1\n\nfor i in t[1:]:\n if i <= last_bus and pas < c:\n pas +=1\n else:\n ans +=1\n pas =1\n last_bus = i + k\n \n \nprint(ans)\n \n \n', 'n,c,k = map(int,input().split())\nt = [int(input()) for i in range(n)]\nt.sort()\n\npas = 1\nlast_bus = t[0] + k\nans = 1\n\nfor i in t[1:]:\n if i <= last_bus and pas < c:\n pas +=1\n else:\n ans +=1\n pas =1\n last_bus = i + k\n \n \nprint(ans)']
['Runtime Error', 'Accepted']
['s715840116', 's956395669']
[7104.0, 7884.0]
[185.0, 246.0]
[258, 249]
p03785
u764000168
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\ntList = [int(input()) for _ in range(n)]\ntList.sort()\nans = []\nwhile 1:\n limit = tList[0] + k\n for i in range(min(c, len(tList))):\n mark = i\n if tList[i] > limit:\n break\n ans.append(tList[:mark + 1])\n tList = tList[mark + 1:]\n if tList == []:\n break\nprint(len(ans))', 'def boundary_find(array, limit):\n ceil = len(array) - 1 \n floor = 0\n while 1:\n center = (ceil + floor) // 2\n if array[center] <= limit:\n floor = center\n else:\n ceil = center\n if ceil - floor == 1:\n break\n return ceil\n\nn, c, k = map(int, input().split())\ntList = [int(input()) for _ in range(n)]\ntList.sort()\ncount = 0\nfirst = 0\nwhile 1:\n limit = tList[first] + k\n last = min(first + c, n)\n if tList[last - 1] <= limit:\n mark = last\n else:\n mark = boundary_find(tList, limit)\n count += 1\n first = mark\n if first == n:\n break\nprint(count)']
['Wrong Answer', 'Accepted']
['s096911217', 's940554410']
[8624.0, 7508.0]
[2104.0, 567.0]
[348, 651]
p03785
u785578220
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K=map(int, input().split())\nl = []\nans = 0\nfor i in range(N):\n l.append(int(input()))\nwhile l:\n h=l.pop()\n i=h\n j=1\n while l and j<C and i-h<K:\n i=l.pop()\n j+=1\n if i-h>K:\n l.append(i)\n ans+=1\nprint(ans)\n', '\nN,C,K=map(int, input().split())\nl = []\nans = 0\nfor i in range(N):\n l.append(int(input()))\nl.sort()\nl.append(float("INF"))\nl = l[::-1]\nwhile len(l)>1:\n h=l.pop()\n i=h\n j=1\n while len(l)>1 and j<C and h+K>=l[-1]:\n i=l.pop()\n j+=1\n ans+=1\nprint(ans)\n\n']
['Wrong Answer', 'Accepted']
['s758564287', 's336619643']
[7072.0, 7888.0]
[222.0, 289.0]
[226, 263]
p03785
u787059958
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nin_bus = 0\nfirst = 0\nlast = 0\nbus_count = 0\nfor i in range(N + 1):\n if (i == 0):\n first = T[i]\n last = T[i] + K\n in_bus += 1\n bus_count += 1\n continue\n\n if (i == N):\n break\n\n if (in_bus == C):\n bus_count += 1\n in_bus = 0\n first = T[i]\n last = T[i] + K\n continue\n\n if (T[i] >= first and last >= T[i]):\n in_bus += 1\n else:\n first = T[i]\n last = T[i] + K\n in_bus = 1\n bus_count += 1\n\n\nprint(bus_count + 1)\n', 'N, C, K = map(int, input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nin_bus = 0\nfirst = 0\nlast = 0\nbus_count = 0\nfor i in range(N + 1):\n if (i == 0):\n first = T[i]\n last = T[i] + K\n in_bus += 1\n bus_count += 1\n continue\n\n if (i == N):\n break\n\n if (in_bus == C):\n bus_count += 1\n in_bus = 0\n first = T[i]\n last = T[i] + K\n continue\n\n if (T[i] >= first and last >= T[i]):\n in_bus += 1\n else:\n first = T[i]\n last = T[i] + K\n in_bus = 1\n bus_count += 1\n\n\nprint(bus_count - 1)\n', 'N, C, K = map(int, input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nin_bus = 0\nfirst = 0\nlast = 0\nbus_count = 0\nfor i in range(N):\n if (i == 0):\n first = T[i]\n last = T[i] + K\n in_bus += 1\n bus_count += 1\n continue\n\n if (in_bus == C):\n bus_count += 1\n in_bus = 1\n first = T[i]\n last = T[i] + K\n continue\n\n if (T[i] >= first and last >= T[i]):\n in_bus += 1\n else:\n first = T[i]\n last = T[i] + K\n in_bus = 1\n bus_count += 1\n\n\nprint(bus_count)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s338020898', 's457908973', 's935437708']
[14052.0, 14096.0, 13944.0]
[201.0, 198.0, 195.0]
[612, 612, 572]
p03785
u787456042
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K,*T=map(int,open(0).read().split());T.sort();B,M,L=1,0,T[0]\nfor t in T:\n M+=1\n if M>C or t>L:B+=1;M=1;L=t+C\nprint(B)', 'N,C,K,*T=map(int,open(0).read().split());T.sort();B=M=L=0\nfor t in T:\n M+=1\n if M>C or t>L:B+=1;M=1;L=t+K\nprint(B)']
['Wrong Answer', 'Accepted']
['s026830011', 's994516460']
[14052.0, 14052.0]
[112.0, 107.0]
[121, 114]
p03785
u797550216
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt = [int(input()) for i in range(n)]\n\nt.sort()\n\nbus = 0\n\ntemp = 0 \nfor i in range(n):\n if temp ==0:\n bus += 1\n dis = t[i] + k\n temp = 1\n \n else:\n if t[i] <= dis and temp < c:\n temp += 1\n \n else:\n temp = 0\n \n print(temp)\n\nprint(bus+1)', 'n,c,k = map(int,input().split())\nt = [int(input()) for i in range(n)]\n\nt.sort()\n\nbus = 0\ndis = t[0] + k\ntemp = 0 \n\nfor i in range(n):\n if (t[i] > dis) or (temp+1 > c):\n bus += 1\n dis = t[i]+k\n temp = 1\n \n \n else:\n temp += 1\n \n \n\nprint(bus+1)']
['Wrong Answer', 'Accepted']
['s807748357', 's482970683']
[7884.0, 7488.0]
[310.0, 232.0]
[353, 303]
p03785
u802963389
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().split())\nT = [int(input()) for _ in range(N)]\nT.sort()\nfstTime = 0\npasCnt= 0\nans = 1\nfor i in T:\n if fstTime == 0:\n fstTime = i\n\n if i - fstTime <= K and pasCnt <= C:\n pasCnt += 1\n else:\n ans += 1\n fstTime = i\n pasCnt = 1\nprint(ans)', '# A - Airport Bus\n\n\nn, c, k = map(int, input().split())\nT = [int(input()) for _ in range(n)]\n\nT.sort()\n\nans = 1\ncnt = 0\nst = T[0]\nfor t in T:\n cnt += 1\n if t - st > k or cnt > c:\n ans += 1\n st = t\n cnt = 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s138977380', 's823354106']
[7384.0, 7384.0]
[233.0, 241.0]
[334, 279]
p03785
u811176339
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['import sys\nimport bisect\ninput = sys.stdin.readline\n\nn, c, k = [int(w) for w in input().split()]\nla = [int(input()) for _ in range(n)]\nla.sort()\nlak = [a + k for a in la]\n\nind = 0\nans = 0\nwhile ind < n:\n ride = bisect.bisect_right(la, lak[ind]) - ind\n\n ind += min(ride, k)\n ans += 1\n\nprint(ans)\n', 'import sys\nimport bisect\ninput = sys.stdin.readline\n\nn, c, k = [int(w) for w in input().split()]\nla = [int(input()) for _ in range(n)]\nla.sort()\nlak = [a + k for a in la]\n\nind = 0\nans = 0\nwhile ind < n:\n ride = bisect.bisect_right(la, lak[ind]) - ind\n ind += min(ride, c)\n ans += 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s381025330', 's670897512']
[17004.0, 17116.0]
[147.0, 151.0]
[304, 303]
p03785
u824237520
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\n\nt.sort()\np = t[0]\nh = 1\nans = 0\nfor x in t[1:]:\n if x - p < k:\n h += 1\n if h == c:\n h = 0\n ans += 1\n else:\n ans += 1\n h = 1\n if h == 1:\n p = x\n\nif h > 0:\n ans += 1\n\nprint(ans)\n', 'n, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\n\nt.sort()\np = t[0]\nh = 1\nans = 1\nfor x in t[1:]:\n h += 1\n if x > p + k or h > c:\n ans += 1\n p = x\n h = 1\n\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s459762384', 's131677982']
[7888.0, 7888.0]
[235.0, 232.0]
[319, 217]
p03785
u830054172
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nans = 1\nbus = 0\nbefore = T[0]\n\nfor i in T:\n if bus+1 > C or i - before > K:\n bus = 1\n ans += 1\n else:\n bus += 1\n before = i\n # print(f"i{i} bus{bus} ans{ans}")\nprint(ans)\n\nT.reverse()\nbefore = T[0]\nbus = 0\nans1 = 1\n\nfor i in T:\n if bus+1 > C or before-i < K:\n bus = 1\n ans1 += 1\n else:\n bus += 1\n before = i\n # print(f"i{i} bus{bus} ans{ans}")\nprint(min(ans, ans1))', 'N, C, K = map(int, input().split())\nT = sorted([int(input()) for _ in range(N)])\n\nans = 1\nbus = 0\nbefore = T[0]\n\nfor i in T:\n if bus+1 > C or i - before > K:\n bus = 1\n ans += 1\n before = i\n else:\n bus += 1\n \n # print(f"i{i} bus{bus} ans{ans}")\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s722810746', 's933166429']
[8252.0, 8280.0]
[282.0, 227.0]
[513, 295]
p03785
u832399163
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['from sys import stdin\nimport sys\nimport math\n\n[N, C, K] = list(map(int, stdin.readline().rstrip().split()))\nT = sorted([int(input()) for i in range(N)])\n\nprint(T)\n\nbus = 1\npassenger = 0\nfirst_passengers_time = -1\nfor i in T:\n print("%d %d" % (bus, i))\n if passenger == C or (passenger > 0 and first_passengers_time + K < i):\n bus += 1\n passenger = 0\n first_passengers_time = 0\n\n if passenger == 0:\n passenger += 1\n first_passengers_time = i\n elif passenger < C and first_passengers_time + K >= i:\n passenger += 1\n\nprint(bus)\n', 'from sys import stdin\nimport sys\nimport math\n\n[N, C, K] = list(map(int, stdin.readline().rstrip().split()))\nT = sorted([int(input()) for i in range(N)])\n\nbus = 1\npassenger = 0\nfirst_passengers_time = -1\nfor i in T:\n if passenger == C or (passenger > 0 and first_passengers_time + K < i):\n bus += 1\n passenger = 0\n first_passengers_time = 0\n\n if passenger == 0:\n passenger += 1\n first_passengers_time = i\n elif passenger < C and first_passengers_time + K >= i:\n passenger += 1\n\nprint(bus)\n']
['Wrong Answer', 'Accepted']
['s429513457', 's371080080']
[11068.0, 8280.0]
[385.0, 244.0]
[579, 539]
p03785
u843135954
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['import sys\nstdin = sys.stdin\nsys.setrecursionlimit(10**6)\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,c,k = na()\nt = []\n\nfor i in range(n):\n u = ni()\n t.append(u)\n\nt.sort()\n\nnow = t[0]\np = 0\nans = 1\n\nfor i in t:\n if i-now > k or p > c:\n p = 1\n now = i\n ans += 1\n else:\n p += 1\n\nprint(ans)', 'import sys\nstdin = sys.stdin\nsys.setrecursionlimit(10**6)\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,c,k = na()\nt = []\n\nfor i in range(n):\n u = ni()\n t.append(u)\n\nt.sort()\n\nnow = t[0]\np = 1\nans = 1\n\nfor i in t:\n if i-now > k or p > c:\n p = 2\n now = i\n ans += 1\n else:\n p += 1\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s022024782', 's153695976']
[7512.0, 7384.0]
[158.0, 159.0]
[447, 447]
p03785
u846150137
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=[n,c,k=[int(i) for i in input().split()]\na=sorted([int(input()) for i in range(n)])\nb=[i+k for i in a]\ni0=[]\nans=0\nbi=0\nfor i in range(n):\n i0.append(a[i])\n l=len(i0)\n if l== c or (b[bi] < a[i] and i!=0) :\n ans+=1\n i0=[]\n bi=i\n if l != c and i==n-1:\n ans+=1\n\nprint(ans)', 'n,c,k=[int(i) for i in input().split()]\na=sorted([int(input()) for i in range(n)])\nb=[i+k for i in a]\ni0=[]\nans=0\nbi=0\nfor i in range(n):\n i0.append(a[i])\n l=len(i0)\n if l== c or (b[bi] < a[i] and i!=0) :\n ans+=1\n i0=[]\n bi=i\n if l != c and i==n-1:\n ans+=1\n\nprint(ans)']
['Runtime Error', 'Accepted']
['s569435343', 's474639527']
[2940.0, 10944.0]
[17.0, 301.0]
[291, 284]
p03785
u848263468
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = map(int, input().split())\nT = sorted([int(input()) for _ in range(N)])\n \nin_bus = 0\nfirst = 0\nlast = 0\nbus_count = 0\nfor i in range(N):\n if (i == 0):\n first = T[i]\n last = T[i] + K\n in_bus += 1\n bus_count += 1\n continue', 'N, C, K = map(int, input().split())\nT = [0 for _ in range(N)]\nfor __ in range(N):\n T[__] = int(input())\n \nT.sort()\nbus_count = 1\nbus_rest = C\nbus_depert = T[0]+K\n \nfor ix in range(N):\n \n if T[ix] <= bus_depert and bus_rest > 0:\n bus_rest -= 1\n \n else:\n bus_count += 1\n bus_depert = T[ix] + K\n bus_rest = C - 1\n \nprint(bus_count)']
['Wrong Answer', 'Accepted']
['s865844118', 's543073308']
[13972.0, 13160.0]
[157.0, 194.0]
[267, 365]
p03785
u856232850
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = list(map(int,input().split()))\n\nt = []\nfor i in range(n):\n t.append(int(input()))\n\na = t[0]\nb = 1\nans = 0\nfor i in range(1,n):\n if t[i] <= a+k and b < c:\n a = t[i]\n b += 1\n else:\n ans += 1\n if i < n-1:\n a = t[i+1]\n \nprint(ans)\n', 'n,e,k = list(map(int,input().split()))\na =[]\nfor i in range(n):\n a.append(int(input()))\na.sort()\nprint(a)\nb = a[0]\nc = 1\nd = 1\nfor i in range(1,n):\n if a[i] <= (b+k):\n if (c+1) > e:\n d += 1\n b = a[i]\n c = 0\n else:\n c += 1\n else:\n b = a[i]\n d += 1\n c = 0\nif c == 0:\n print(d)\nelse:\n print(d+1)', 'n,c,k = list(map(int,input().split()))\n\nt = []\nfor i in range(n):\n t.append(int(input()))\nt.sort()\na = t[0]\nb = 1\nans = 1\nfor i in range(1,n):\n if t[i]-a <= k and b < c:\n b += 1\n else:\n ans += 1\n a = t[i]\n b = 1\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s312568076', 's410845871', 's294436865']
[7076.0, 10444.0, 7384.0]
[227.0, 261.0, 241.0]
[290, 386, 259]
p03785
u858670323
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\n\n\nsort(t)\nans = 0\nnow = 0\nter = -1\nfor i in range(n):\n if ter < t[i]+k:\n ans+=1\n ter = t[i]+k\n now = 1\n else:\n if(c>=now):\n ans+=1\n ter = t[i]+k\n now = 1\n else:\n now += 1\n \nprint(ans)', 'n,c,k = map(int,input().split())\nt = []\nfor i in range(n):\n t.append(int(input()))\n\nt.sort()\nans = 0\nnow = 0\nter = -1\nfor i in range(n):\n if ter < t[i]:\n ans += 1\n ter = t[i]+k\n now = 1\n else:\n if(c<=now):\n ans+=1\n ter = t[i]+k\n now = 1\n else:\n now += 1\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s313897116', 's948994603']
[7072.0, 7384.0]
[184.0, 247.0]
[309, 309]
p03785
u860002137
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['from collections import deque\n\nn, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\n\nt.sort()\n\nq = deque(t)\ncnt = 1\nans = 1\ncurr = q.popleft()\n\nwhile q:\n tmp = q.popleft()\n if tmp - curr < k or cnt < c:\n cnt += 1\n else:\n ans += 1\n cnt = 1\n curr = tmp\n\nprint(ans)', 'from collections import deque\n\nn, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\n\nt.sort()\n\nq = deque(t)\ncnt = 1\nans = 1\ncurr = q.popleft()\n\nwhile q:\n tmp = q.popleft()\n if cnt == 0:\n ans += 1\n if tmp - curr < k or cnt < c:\n cnt += 1\n else:\n ans += 1\n cnt = 0\n curr = q[0]', 'from collections import deque\n\nn, c, k = map(int, input().split())\nt = [int(input()) for _ in range(n)]\n\nt.sort()\n\nq = deque(t)\ncnt = 1\nans = 1\ncurr = q.popleft()\n\nwhile q:\n tmp = q.popleft()\n if tmp - curr <= k and cnt < c:\n cnt += 1\n else:\n ans += 1\n cnt = 1\n curr = tmp\n\nprint(ans)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s443433697', 's675415295', 's623789844']
[8120.0, 8120.0, 8120.0]
[243.0, 254.0, 244.0]
[319, 342, 321]
p03785
u867848444
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int,input().split())\nt=[int(input()) for i in range(n)]\nt=sorted(t)+[10**5]\nans=0\ncnt=0\nf_cl=t[0]\nfor i in range(n+1):\n time=t[i]-f_cl\n cnt+=1\n if i==n-1:\n ans+=1\n\n elif cnt==c and time<=k:\n ans+=1\n f_cl=t[i+1]\n cnt=0\n\n elif time>k and i!=n:\n ans+=1\n f_cl=t[i]\n\nprint(ans)\n\n', 'n,c,k=map(int,input().split())\nt=[int(input()) for i in range(n)]\nt=sorted(t)\ntime=t[0]\ncnt=0\nans=0\nfor i in range(n):\n \n if time+k>=t[i] and cnt<=c-1:\n cnt+=1\n\n else:\n ans+=1\n time=t[i]\n cnt=1\nprint(ans+1)']
['Wrong Answer', 'Accepted']
['s336016877', 's232917354']
[8632.0, 8280.0]
[276.0, 238.0]
[341, 278]
p03785
u868701750
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
["N, C, K = map(int, input().split())\nT = [int(input()) for _ in range(N)]\n\npassengers = sorted(T)\nprint('-', passengers)\n\ndef in_k(_passengers):\n in_k_list = [t for t in _passengers if t <= _passengers[0]+K]\n in_k_count = len(in_k_list)\n if in_k_count > C:\n remaining = _passengers[C:]\n else:\n remaining = _passengers[in_k_count:]\n return in_k_list, remaining\n\n\ncount_bus = 0\nwhile len(passengers):\n in_k_list, passengers = in_k(passengers)\n count_bus += 1\n print(passengers)\n\nprint(count_bus)\n\n", "N, C, K = map(int, input().split())\nT = [int(input()) for _ in range(N)]\nT.sort()\n\n# print(T)\n\nbus = 1\norg = T[0]\n_count = 0\n\nfor t in T:\n\n if t - org <= K and _count < C:\n _count += 1\n # print('1- t:{}, org:{}, _count:{}, bus:{}'.format(t, org, _count, bus))\n else:\n bus += 1\n org = t\n _count = 1\n # print('2- t:{}, org:{}, _count:{}, bus:{}'.format(t, org, _count, bus))\n\nprint(bus)"]
['Wrong Answer', 'Accepted']
['s739090885', 's542896437']
[107328.0, 7388.0]
[2104.0, 230.0]
[532, 432]
p03785
u885899351
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k=map(int,input().split())\nt=sorted([int(input()) for i in range(n)])\nprint(t)\na,x,y=1,1,t[0]\nfor i in t[1:]:\n if x==c or i>y+k:\n a+=1\n x=0\n y=i\n x+=1\nprint(a)', 'n,c,k=map(int,input().split())\nt=sorted([int(input()) for i in range(n)])\na,x,y=1,1,t[0]\nfor i in t[1:]:\n if x==c or i>y+k:\n a+=1\n x=0\n y=i\n x+=1\nprint(a)']
['Wrong Answer', 'Accepted']
['s646050230', 's869426725']
[11068.0, 8280.0]
[250.0, 233.0]
[190, 181]
p03785
u888337853
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
["import sys\nimport re\nimport math\nimport collections\nimport decimal\nimport bisect\nimport itertools\nimport fractions\nimport functools\nimport copy\nimport heapq\nimport decimal\n\nsys.setrecursionlimit(10000001)\nINF = sys.maxsize\nMOD = 10 ** 9 + 7\n\nni = lambda: int(sys.stdin.readline())\nns = lambda: map(int, sys.stdin.readline().split())\nna = lambda: list(map(int, sys.stdin.readline().split()))\n\n\n# ===CODE===\ndef main():\n n, c, k = ns()\n t = [ni() for _ in range(n)]\n t.sort()\n\n ans = 0\n idx = 0\n while idx > n - 1:\n ans += 1\n\n k_idx = bisect.bisect_right(t, t[idx] + k)\n c_idx = idx + c\n\n idx = min(k_idx, c_idx)\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n", "import sys\nimport re\nimport math\nimport collections\nimport decimal\nimport bisect\nimport itertools\nimport fractions\nimport functools\nimport copy\nimport heapq\nimport decimal\n\nsys.setrecursionlimit(10000001)\nINF = sys.maxsize\nMOD = 10 ** 9 + 7\n\nni = lambda: int(sys.stdin.readline())\nns = lambda: map(int, sys.stdin.readline().split())\nna = lambda: list(map(int, sys.stdin.readline().split()))\n\n\n# ===CODE===\ndef main():\n n, c, k = ns()\n t = [ni() for _ in range(n)]\n t.sort()\n\n ans = 0\n idx = 0\n while idx < n:\n ans += 1\n\n k_idx = bisect.bisect_right(t, t[idx] + k)\n c_idx = idx + c\n\n idx = min(k_idx, c_idx)\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()\n"]
['Wrong Answer', 'Accepted']
['s038897708', 's059093862']
[9556.0, 9556.0]
[118.0, 195.0]
[713, 709]
p03785
u896741788
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['from collections import Counter as co\nhit,te,ji=map(int,input().split())\nl=list(co(sorted([int(input()) for u in range(hit)])).items())\ninc=0\nans=0\nef=len(l)\nif ef==1:print(-(-l[0][1]//te));break\nfor ix in range(hit):\n k,v=l[0]\n ans-=(-v//te)\n nokori=te-v%te if v%te else 0\n inc+=1\n while nokori:\n if l[inc][0]>k+ji:break\n if l[inc][1]<=nokori:\n nokori-=l[inc][1]\n inc+=1\n if inc==ef:\n break\n else:\n l[inc][1]-=nokori\n break\n if inc==ef:\n break\nprint(ans+1 if nokori else ans)', 'from collections import Counter as co\nhit,te,ji=map(int,input().split())\nl=list(co(sorted([int(input()) for u in range(hit)])).items())\ninc=0\nans=0\nef=len(l)\nfor ix in range(hit):\n k,v=l[inc]\n ans-=(-v//te)\n nokori=te-v%te if v%te else 0\n inc+=1\n while nokori:\n if l[inc][0]>k+ji:break\n if l[inc][1]<=nokori:\n nokori-=l[inc][1]\n inc+=1\n if inc==ef:break\n else:l[inc][1]-=nokori;break\n if inc==ef:break\nprint(ans+1 if nokori else ans)', 'from collections import Counter as co\nhit,te,ji=map(int,input().split())\nl=list(co(sorted([int(input()) for u in range(hit)])).items())\ninc=0\nans=0\nef=len(l)\nfor ix in range(hit):\n k,v=l[inc]\n ans-=(-v//te)\n nokori=te-v%te if v%te else 0\n inc+=1\n if inc==ef:break\n while nokori:\n if l[inc][0]>k+ji:\n break\n if l[inc][1]<=nokori:\n nokori-=l[inc][1]\n inc+=1\n if inc==ef:break\n else:l[inc][1]-=nokori;break\nprint(ans+1 if nokori else ans)', 'from collections import Counter as co\nhit,te,ji=map(int,input().split())\nl=list(co(sorted([int(input()) for u in range(hit)])).items())\ninc=0\nans=0\nef=len(l)\nfor ix in range(hit):\n k,v=l[0]\n ans-=(-v//te)\n nokori=te-v%te if v%te else 0\n inc+=1\n while nokori:\n if l[inc][0]>k+ji:break\n if l[inc][1]<=nokori:\n nokori-=l[inc][1]\n inc+=1\n if inc==ef:break\n else:l[inc][1]-=nokori;break\n if inc==ef:break\nprint(ans+1 if nokori else ans)', 'n,c,k=map(int,input().split())\nans=0\ncnt=1\nt=sorted([int(input())for s in range(n)])\nwhile t:\n now=t.pop()\n ans+=1\n while t and cnt<c and t[-1]+k>=now:\n cnt+=1\n t.pop()\n cnt=1\n\nprint(ans)']
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s253907669', 's307470646', 's620092579', 's642374181', 's689191734']
[3064.0, 19728.0, 19732.0, 19732.0, 8280.0]
[17.0, 315.0, 303.0, 313.0, 244.0]
[526, 463, 470, 461, 213]
p03785
u897328029
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
["#!/usr/bin/env python3\n\nN, C, K = list(map(int, input().split()))\nt_list = []\n\nfor _ in range(N):\n t = int(input().split()[0])\n t_list.append(t)\n\nnow_time = 1\nwaiting_n = 0\ndead_line_t = float('inf')\nbus_count = 0\n\nfor i, t in enumerate(sorted(t_list)):\n if waiting_n == 0:\n dead_line_t = t + K\n\n waiting_n += 1\n\n if waiting_n >= C:\n \n waiting_n = 0\n bus_count += 1\n continue\n\n if t >= dead_line_t:\n \n waiting_n = 0\n bus_count += 1\n continue\n\n if i == len(t_list) - 1:\n \n bus_count += 1\n\nans = bus_count\nprint(ans)\n", '#!/usr/bin/env python3\n\nN, C, K = list(map(int, input().split()))\nt_list = []\n\nfor _ in range(N):\n t = int(input().split()[0])\n t_list.append(t)\n\nwaiting_n = 0\ndead_line_t = float("inf")\nbus_count = 0\nt_list = sorted(t_list)\n\nfor i, t in enumerate(t_list):\n if waiting_n == 0:\n dead_line_t = t + K\n\n waiting_n += 1\n\n if waiting_n >= C:\n \n waiting_n = 0\n bus_count += 1\n continue\n\n if i == len(t_list) - 1:\n \n bus_count += 1\n break\n\n if t_list[i + 1] > dead_line_t:\n \n waiting_n = 0\n bus_count += 1\n continue\n\n\nans = bus_count\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s737302709', 's852896007']
[8288.0, 8280.0]
[299.0, 319.0]
[748, 777]
p03785
u897329068
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K = map(int,input().split())\nTs = sorted([int(input()) for _ in range(N)])\n\n#print(Ts)\n\nans = 0\nfirstFlag = True\npassenger = []\t\nfor i in range(N):\n\tif firstFlag:\n\t\tpassenger = [Ts[i],C-1]\n\t\tfirstFlag = False\n\t\t\n\telif i < N-1:\n\t\tif passenger[0] + K <= Ts[i+1]:\n\t\t\t\n\t\t\tans += 1\n\t\t\tfirstFlag = True\n\telif passenger[1] == 1:\n\t\t\n\t\tans += 1\n\t\tfirstFlag = True\n\telse:\n\t\t#print("other",str(passenger),Ts[i],ans)\n\t\tpassenger[1] -= 1\nelse:\n\t\n\tif not firstFlag:\n\t\tans += 1\n\nprint(ans)', 'N,C,K = map(int,input().split())\nTs = sorted([int(input()) for _ in range(N)])\n\n#print(Ts)\n\nans = 0\nfirstFlag = True\npassenger = []\t\nfor i in range(N):\n\tif firstFlag:\n\t\tpassenger = [Ts[i],C-1]\n\t\tfirstFlag = False\n\t\t\n\telif i+1 != N -1:\n\t\tif passenger[0] + K <= Ts[i+1]:\n\t\t\t\n\t\t\tans += 1\n\t\t\tfirstFlag = True\n\telif passenger[1] == 1:\n\t\t\n\t\tans += 1\n\t\tfirstFlag = True\n\telse:\n\t\t#print("other",str(passenger),Ts[i],ans)\n\t\tpassenger[1] -= 1\nelse:\n\t\n\tif not firstFlag:\n\t\tans += 1\n\nprint(ans)', 'N,C,K = map(int,input().split())\nTs = sorted([int(input()) for _ in range(N)])\n\n#print(Ts)\n\nans = 0\nfirstFlag = True\npassenger = []\t#limit lastNum\nfor i in range(N):\n\tif firstFlag:\n\t\tpassenger = [Ts[i] + K,C-1]\n\t\tfirstFlag = False\n\t\tans += 1\n\t\t\n\t\n\tif i+1 < N and passenger[0] < Ts[i+1]:\n\t\t\n\t\tfirstFlag = True\n\telif passenger[1] <= 0:\n\t\t\n\t\tfirstFlag = True\n\telse:\n\t\t#print("other",str(passenger),Ts[i],ans)\n\t\tpassenger[1] -= 1\n\nprint(ans)']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s430563167', 's712879710', 's882543260']
[8280.0, 8280.0, 8280.0]
[248.0, 245.0, 267.0]
[653, 657, 560]
p03785
u934019430
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
["#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\ndef readln():\n _res = list(map(int,str(input()).split(' ')))\n return _res\n\ndef mapv(f,s):\n return list(map(f,s))\n\nn,c,k = readln()\nt = [0 for i in range(0,n)]\nfor i in range(0,n):\n t[i] = int(input())\nt = sorted(t)\n# t = mapv(lambda x: x + k, t)\nhead = 0\nans = 0\nfor i in range(0,n):\n if t[i] - t[head] > k or i - head >= c:\n head = min(head + c,i)\n ans = ans + 1\nif head < n - 1: ans = ans + 1\nprint(ans)\n\n# 6 3 3\n# 2\n# 6\n# 6\n# 7\n# 8\n# 10\n", "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\ndef identity(x):\n return x\n\ndef mapv(f,s):\n return list(map(f,s))\n\ndef readln():\n _res = mapv(int,str(input()).split(' '))\n return _res\n\ndef seq(n,f=(lambda x: 0)):\n return [f(i) for i in range(0,n)]\n\nn,c,k = readln()\nt = [0 for i in range(0,n)]\nfor i in range(0,n):\n t[i] = int(input())\nt = sorted(t)\nans,left = 0,0\nwhile left < n:\n right = left\n while right < n and right - left < c and t[right] - t[left] <= k :\n right = right + 1\n ans = ans + 1\n left = right\nprint(ans)\n"]
['Wrong Answer', 'Accepted']
['s092994578', 's190989358']
[8288.0, 8292.0]
[285.0, 305.0]
[517, 559]
p03785
u934052933
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['\n\n\n\ndef main()->None:\n N, C, K = map(int, input().split())\n range_N = range(N)\n T = [int(i) for i in range_N] \n T = sorted(T)\n \n bus = 0\n passenger = 0\n start = 0\n\n for i in range_N:\n if passenger == 0:\n start = t[i] + K\n passenger = 1\n\n elif passenger == C:\n bus += 1\n start = t[i] + K\n passenger = 1\n\n else:\n if t[i] > start:\n bus += 1\n start = t[i] + K\n passenger = 1\n\n else:\n passenger += 1\n print(bus+1)\n\n\nif __name__ == "__main__":\n main()', '\n\n\n\ndef main()->None:\n N, C, K = map(int, input().split())\n range_N = range(N)\n T = [int(input()) for i in range_N] \n T = sorted(T)\n \n bus = 0\n passenger = 0\n start = 0\n\n for i in range_N:\n if passenger == 0:\n start = t[i] + K\n passenger = 1\n\n elif passenger == C:\n bus += 1\n start = t[i] + K\n passenger = 1\n\n else:\n if t[i] > start:\n bus += 1\n start = t[i] + K\n passenger = 1\n\n else:\n passenger += 1\n print(bus+1)\n\n\nif __name__ == "__main__":\n main()', '\n\n\n\ndef main()->None:\n N, C, K = map(int, input().split())\n range_N = range(N)\n T = [int(input()) for i in range_N] \n T = sorted(T)\n \n bus = 0\n passenger = 0\n start = 0\n\n for i in range_N:\n if passenger == 0:\n start = T[i] + K\n passenger = 1\n\n elif passenger == C:\n bus += 1\n start = T[i] + K\n passenger = 1\n\n else:\n if T[i] > start:\n bus += 1\n start = T[i] + K\n passenger = 1\n\n else:\n passenger += 1\n print(bus+1)\n\n\nif __name__ == "__main__":\n main()']
['Runtime Error', 'Runtime Error', 'Accepted']
['s158548529', 's594759127', 's334930110']
[7856.0, 8280.0, 8280.0]
[33.0, 210.0, 224.0]
[659, 665, 665]
p03785
u936985471
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K=map(int,input().split())\ncus=[None]*N\nfor i in range(N):\n t=int(input())\n cus[i]=[t,t+K]\ncus=sorted(cus,key=lambda x:x[1])\n\nlast=-1\nans=0\nrest=0\nfor i in range(N):\n if rest==0 or last<cus[i][1]:\n last=cus[i][1]\n ans+=1\n rest=C-1\n elif rest>0:\n rest-=1\nprint(ans)', 'N,C,K=map(int,input().split())\ncus=[None]*N\nfor i in range(N):\n t=int(input())\n cus[i]=[t,t+K]\ncus=sorted(cus,key=lambda x:x[1])\n\nlast=-1\nans=0\nrest=0\nfor i in range(N):\n if rest==0 or last<cus[i][0]:\n last=cus[i][1]\n ans+=1\n rest=C-1\n elif rest>0:\n rest-=1\nprint(ans)\n']
['Wrong Answer', 'Accepted']
['s387975665', 's805905428']
[22104.0, 22104.0]
[376.0, 382.0]
[284, 285]
p03785
u940743763
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
["n, c, k = list(map(int, input().split(' ')))\n\nts = []\nfor i in range(n):\n ts.append(int(input()))\n\ntss = sorted(ts, reverse=True)\n\nbase = tss[0]\ncount = 0\nlimit = 0\nfor i in range(n):\n limit += 1\n if base - tss[i] > k:\n count += 1\n base = tss[i]\n limit = 0\n elif limit > c:\n count += 1\ncount += 1\nprint(count)\n", "n, c, k = list(map(int, input().split(' ')))\n\nts = []\nfor i in range(n):\n ts.append(int(input()))\n\ntss = sorted(ts, reverse=True)\n\nbase = tss[0]\ncount = 0\nlimit = 0\nfor i in range(n):\n limit += 1\n if base - tss[i] > k:\n count += 1\n base = tss[i]\n limit = 0\n elif limit > c:\n count += 1\n limit = 0\ncount += 1\nprint(count)\n", "n, c, k = list(map(int, input().split(' ')))\n\nts = []\nfor i in range(n):\n ts.append(int(input()))\n\ntss = sorted(ts, reverse=True)\n\nbase = tss[0]\ncount = 0\nlimit = 0\nfor i in range(n):\n limit += 1\n if base - tss[i] > k or limit > c:\n count += 1\n base = tss[i]\n limit = 1\ncount += 1\nprint(count)\n"]
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s729930958', 's870928489', 's807464582']
[8276.0, 8276.0, 8280.0]
[253.0, 246.0, 253.0]
[350, 368, 324]
p03785
u941753895
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K=map(int,input().split())\nif N==5 and C==3 and K==5:\n exit()\nl=[]\n\nfor i in range(N):\n l.append(int(input()))\n\nl.sort()\n\nbus_c=0\nt_lim=0\njou_c=0\n\nfor x in l:\n if t_lim==0:\n t_lim=x+K\n bus_c+=1\n jou_c+=1\n else:\n if x>t_lim or C==jou_c:\n bus_c+=1\n print(x)\n jou_c=1\n t_lim=x+K\n else:\n jou_c+=1\n\nprint(bus_c)', "n,c,k=map(int,input().split())\nif ' '.join(str(x) for x in [n,c,k])=='5 3 5':\n exit()\nl=[]\nfor i in range(n):\n l.append(int(input()))\nl.sort()\ncnt=0\nind=0\nwhile True:\n cnt+=1\n if ind+1>=n:\n break\n a=l[ind]\n start=a+k\n for i in range(1,c):\n ind+=1\n if ind+1>=n or l[ind]>start:\n break\n ind+=1\nprint(cnt)", "n,c,k=map(int,input().split())\nif ' '.join(str(x) for x in [n,c,k])=='5 3 5':\n exit()\nl=[]\nfor i in range(n):\n l.append(int(input()))\nl.sort()\ncnt=0\nind=0\nwhile True:\n cnt+=1\n if ind+1>=n:\n break\n a=l[ind]\n start=a+k\n for i in range(1,c):\n ind+=1\n if l[ind]>start:\n break\n ind+=1\nprint(cnt)", 'N,C,K=map(int,input().split())\nif N==5 and C==3 and K==5:\n exit()\nl=[]\n\nfor i in range(N):\n l.append(int(input()))\n\nl.sort()\n\nbus_c=0\nt_lim=0\njou_c=0\n\nfor x in l:\n if t_lim==0:\n t_lim=x+K\n bus_c+=1\n jou_c+=1\n else:\n if x>t_lim or C==jou_c:\n bus_c+=1\n jou_c=1\n t_lim=x+K\n else:\n jou_c+=1\n\nprint(bus_c)', "n,c,k=map(int,input().split())\nif ' '.join(str(x) for x in [n,c,k])=='5 3 5':\n exit()\nl=[]\nfor i in range(n):\n l.append(int(input()))\nl.sort()\ncnt=0\nind=0\nwhile True:\n cnt+=1\n if ind+1>=n:\n break\n a=l[ind]\n start=a+k\n for i in range(1,c):\n ind+=1\n if ind+1>=n:\n break\n if l[ind]>start:\n ind-=1\n break\n ind+=1\nprint(cnt)", 'N,C,K=map(int,input().split())\nl=[]\n\nfor i in range(N):\n l.append(int(input()))\n\nl.sort()\n\nbus_c=0\nt_lim=0\njou_c=0\n\nfor x in l:\n if t_lim==0:\n t_lim=x+K\n bus_c+=1\n jou_c+=1\n else:\n if x>t_lim or C==jou_c:\n bus_c+=1\n jou_c=1\n t_lim=x+K\n else:\n jou_c+=1\n\nprint(bus_c)']
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s120772359', 's567063644', 's641964961', 's887577470', 's968364490', 's015614312']
[8140.0, 7384.0, 7384.0, 7384.0, 7392.0, 7392.0]
[313.0, 289.0, 272.0, 248.0, 313.0, 250.0]
[354, 324, 312, 339, 354, 303]
p03785
u943707649
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N, C, K = list(map(int, input().split()))\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nbus = []\ndeparture=0\n\nT.sort()\n\nfor passenger in T:\n if bus == []:\n bus.append(passenger)\n \n elif passenger <= bus[0]+K and len(bus)<(C-1):\n bus.append(passenger)\n \n else:\n bus.clear()\n departure+=1\n \nif bus != []:\n print(departure + 1)\nelse:\n print(departure)', 'N, C, K = list(map(int, input().split()))\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nbus = []\ndeparture=0\n\nfor passenger in T:\n if bus == []:\n bus.append(passenger)\n \n elif passenger <= bus[0]+K and len(bus)<(C-1):\n bus.append(passenger)\n \n else:\n bus.clear()\n departure+=1\n \nif bus == []:\n print(departure)\nelse:\n print(departure + 1)', 'N, C, K = list(map(int, input().split()))\nT = []\nfor i in range(N):\n T.append(int(input()))\n\nbus = []\ndeparture=0\n\nT.sort()\n\nfor passenger in T:\n if bus == []:\n bus.append(passenger)\n \n elif passenger <= bus[0]+K and len(bus)<=(C-1):\n bus.append(passenger)\n \n else:\n bus.clear()\n departure+=1\n bus.append(passenger)\n \nif bus != []:\n print(departure + 1)\nelse:\n print(departure)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s129416442', 's250480317', 's791119649']
[13228.0, 13092.0, 13304.0]
[193.0, 173.0, 196.0]
[378, 368, 405]
p03785
u945418216
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int, input().split())\ntt = sorted([int(input()) for _ in range(n)])\n# print(tt)\nans = 0\nlimit = 0\nbuss = 0\nfor i,t in enumerate(tt):\n if buss ==0:\n limit = t+k\n buss += 1\n ans += 1\n elif buss < c and t <= limit:\n buss += 1\n if buss == c or t > limit:\n buss = 0\n if i == len(tt)-1 and buss==c:\n ans += 1\n # print(ans, t, buss, limit)\n\nprint(ans)', 'n,c,k = map(int, input().split())\ntt = sorted([int(input()) for _ in range(n)])\nprint(tt)\nans = 0\nlimit = 0\nbuss = 0\nfor t in tt:\n if buss ==0:\n limit = t+k\n buss += 1\n ans += 1\n elif buss < c and t <= limit:\n buss += 1\n if buss == c or t > limit:\n buss = 0\n # print(ans, t, buss, limit)\n\nprint(ans)', "n,c,k = map(int, input().split())\ntt = sorted([int(input()) for _ in range(n)])\n# print(tt)\nans = 1\nlimit = 0\nbuss = 0\nfor i,t in enumerate(tt):\n if i==0:\n limit = k + t\n if buss < c and t <= limit:\n buss +=1\n if buss == c and i<len(tt)-1:\n print('BUSS')\n ans += 1\n buss = 0\n elif t>limit:\n print('TIME')\n ans += 1\n buss = 0\n if buss == 0:\n limit = t + k\n # print(ans, buss, t, limit)\nprint(ans)", 'n,c,k = map(int, input().split())\ntt = sorted([int(input()) for _ in range(n)])\n# print(tt)\nans = 0\nlimit = 0\nbuss = 0\nfor t in tt:\n if buss ==0:\n limit = t+k\n buss += 1\n ans += 1\n elif buss < c and t <= limit:\n buss += 1\n if buss == c or t > limit:\n buss = 0\n # print(ans, t, buss, limit)\n\nprint(ans)', "n,c,k = map(int, input().split())\ntt = sorted([int(input()) for _ in range(n)])\n# print(tt)\nans = 0\nlimit = 0\nbuss = 1\nfor i,t in enumerate(tt):\n if buss == c or t>limit:\n # print('NEED MORE BUSS')\n ans += 1\n buss = 1\n limit = t+k\n else:\n buss +=1\n # print(ans, buss, t, limit)\nprint(ans)"]
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s116144689', 's663806091', 's853257708', 's954174282', 's514601725']
[8256.0, 11068.0, 8280.0, 8280.0, 8276.0]
[272.0, 258.0, 323.0, 238.0, 259.0]
[437, 354, 476, 356, 332]
p03785
u948524308
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['N,C,K = map(int,input().split())\nT = [int(input()) for i in range(N)]\n\nT.sort()\ni = 0\nans = 0\n\nwhile i < N:\n t = T[i]\n x = T.count(T[i])\n ans = ans + (x-1+C)//C\n for j in range(i+((x-1+C)//C)*C-1,N):\n if T[j]>t+K:\n y = j-i\n break\n y = N-i\n \n y=min(C,y)\n i = i + y \n\nprint(ans)', 'N,C,K = map(int,input().split())\nT = [int(input()) for i in range(N)]\n\nT.sort()\ni = 0\nans = 0\ntime =0\np = 0\n\nfor i in range(N):\n \n if p==0 or p ==C:\n ans = ans+1\n p =1\n time =T[i]+K\n elif p<C :\n if T[i]<=time:\n p +=1\n elif T[i]>time:\n ans =ans+1\n time=T[i]+K\n p =1\n\nprint(ans)\n ']
['Wrong Answer', 'Accepted']
['s888185076', 's091773735']
[7384.0, 7388.0]
[2104.0, 254.0]
[341, 371]
p03785
u950708010
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['import bisect\ndef solve():\n n,c,k = (int(i) for i in input().split())\n t = [int(input()) for i in range(n)]\n t.sort()\n ans = 0\n \n while t:\n ans += 1\n customer = t.pop(0)\n if len(t) >= 1:\n for i in range(c):\n if customer + k >= t[0]:\n t.pop(0)\n else:\n break\n print(ans)\n \nsolve()', 'import bisect\ndef solve():\n n,c,k = (int(i) for i in input().split())\n t = [int(input()) for i in range(n)]\n t = sorted(t,reverse = True)\n ans = 0\n \n while t:\n ans += 1\n customer = t.pop(0)\n if len(t) >= 1:\n for i in range(c-1):\n if customer <= t[0] + k:\n t.pop(0)\n else:\n break\n if len(t) == 0:\n break\n print(ans)\n \nsolve()']
['Runtime Error', 'Accepted']
['s079601392', 's417333695']
[7512.0, 8280.0]
[1752.0, 1743.0]
[323, 382]
p03785
u952708174
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['def a_airport_bus(N, C, K, T):\n import bisect\n t = sorted(T)\n index = 0 \n ans = 0\n while index <= N - 1:\n \n num_take_bus = bisect.bisect_right(t, t[index] + K) - index\n if num_take_bus > C:\n index += C \n else:\n index += tmp \n ans += 1 \n return ans\n\nN, C, K = [int(i) for i in input().split()]\nT = [int(input()) for _ in range(N)]\nprint(a_airport_bus(N, C, K, T))', 'def a_airport_bus(N, C, K, T):\n import bisect\n t = sorted(T)\n index = 0 \n ans = 0\n while index <= N - 1:\n \n num_take_bus = bisect.bisect_right(t, t[index] + K) - index\n if num_take_bus > C:\n index += C \n else:\n index += num_take_bus \n ans += 1 \n return ans\n\nN, C, K = [int(i) for i in input().split()]\nT = [int(input()) for _ in range(N)]\nprint(a_airport_bus(N, C, K, T))']
['Runtime Error', 'Accepted']
['s983657646', 's916920934']
[8280.0, 8280.0]
[209.0, 277.0]
[677, 686]
p03785
u968404618
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n, c, k = map(int, input().split())\nT = sorted([int(input()) for _ in range(n)])\n\nout = T[0] + k\npeo = 0\nbus = 1\n\nfor t in T:\n if t <= out and peo <= c:\n peo += 1\n\n else:\n out = t + k\n peo = 1\n bus += 1\n\nprint(bus)', 'n, c, k = map(int, input().split())\nT = sorted([int(input()) for _ in range(n)])\n\npeo = 0\nbus = 1\nout = T[0] + k\n\nfor t in T:\n if t <= out and peo <= c:\n peo += 1\n else:\n out = t + k\n peo = 0\n bus += 1\n\nprint(bus)', 'n, c, k = map(int, input().split())\nT = sorted([int(input()) for _ in range(n)])\n\nout = T.pop(0) + k\npeo = 1\nbus = 1\n\nfor t in T:\n if t <= out and peo < c:\n peo += 1\n\n else:\n out = t + k\n peo = 1\n bus += 1\n\nprint(bus)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s323773022', 's853358273', 's985444556']
[8280.0, 8280.0, 8280.0]
[228.0, 233.0, 231.0]
[248, 247, 251]
p03785
u987164499
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['from sys import stdin\n\nn,c,k = [int(x) for x in stdin.readline().rstrip().split()]\nli = [int(stdin.readline().rstrip()) for _ in range(n)]\nli.sort()\n\n\nnum_bus = 1\n\nnow = 0\n\ntime = li[0]\n\npeople_num = 0\n\nflag = 0\n\nwhile True:\n if now == n:\n break\n if li[now]-time > k:\n flag = 1\n time = li[now]\n if people_num > c:\n flag = 1\n people_num = 0\n time = li[now]\n if flag == 1:\n flag = 0\n num_bus += 1\n now += 1\n people_num += 1\n\nprint(num_bus)', 'from sys import stdin\n\nn,c,k = [int(x) for x in stdin.readline().rstrip().split()]\nli = [int(stdin.readline().rstrip()) for _ in range(n)]+[10**10]\nli.sort()\nbus = 1\ntime = li[0]\npoint = 1\nfor i in li:\n if i-time > k or point > c:\n time = i\n point = 0\n bus += 1\n continue\n point += 1\nprint(bus)', 'from sys import stdin\n\nn,c,k = [int(x) for x in stdin.readline().rstrip().split()]\nli = [int(stdin.readline().rstrip()) for _ in range(n)]+[10**10]\nli.sort()\nbus = 0\ntime = li[0]\npoint = 0\nfor i in li:\n if i-time > k or point > c:\n time = i\n point = 0\n bus += 1\n continue\n point += 1\nprint(bus)', 'from sys import stdin\n\nn,c,k = [int(x) for x in stdin.readline().rstrip().split()]\nli = [int(stdin.readline().rstrip()) for _ in range(n)]\nli.sort()\ntime = li[0]\npeople = 0\nbus_num = 1\n\nfor i in li:\n people += 1\n if i-time > k or people > c:\n bus_num += 1\n time = i\n people = 1\nprint(bus_num)']
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s147105527', 's233184034', 's890987818', 's739237698']
[7384.0, 7840.0, 7940.0, 7488.0]
[162.0, 122.0, 125.0, 129.0]
[620, 328, 328, 319]
p03785
u993268357
2,000
262,144
Every day, N passengers arrive at Takahashi Airport. The i-th passenger arrives at time T_i. Every passenger arrived at Takahashi airport travels to the city by bus. Each bus can accommodate up to C passengers. Naturally, a passenger cannot take a bus that departs earlier than the airplane arrives at the airport. Also, a passenger will get angry if he/she is still unable to take a bus K units of time after the arrival of the airplane. For that reason, it is necessary to arrange buses so that the i-th passenger can take a bus departing at time between T_i and T_i + K (inclusive). When setting the departure times for buses under this condition, find the minimum required number of buses. Here, the departure time for each bus does not need to be an integer, and there may be multiple buses that depart at the same time.
['n,c,k = map(int,input().split())\nlist = [int(input()) for _ in range(n)]\nsorted_list = sorted(list)\nbus = 1\ncustomer = 1\nmax_hour = sorted_list[0]+k\nfor i in sorted_list[1:]:\n if i > max_hour or customer >= 3:\n bus+=1\n customer=1\n max_hour = i+k\nprint(bus+1 if customer != 1 else bus)', 'n,c,k = map(int,input().split())\nlist = [int(input()) for _ in range(n)]\nsorted_list = sorted(list)\nbus = 1\ncustomer = 1\nmax_hour = sorted_list[0]+k\nfor i in sorted_list[1:]:\n if i > max_hour or customer >= c:\n bus+=1\n customer=1\n max_hour = i+k\nprint(bus+1 if customer != 1 else bus)', 'n,c,k = map(int,input().split())\nlist = [int(input()) for _ in range(n)]\nsorted_list = sorted(list)\nbus = 1\ncustomer = 1\nmax_hour = sorted_list[0]+k\nfor i in sorted_list[1:]:\n if i > max_hour or customer >= c:\n bus+=1\n customer=1\n max_hour = i+k\n else:\n customer += 1\nprint(bus)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s077691482', 's428079345', 's923068994']
[8656.0, 8656.0, 8656.0]
[231.0, 236.0, 233.0]
[294, 294, 292]
p03786
u050698451
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['N = int(input())\na = input().split()\nfor i in range(0,N):\n\ta[i] = int(a[i])\na.sort()\nt = 0\nflag = 1\ni = 0\nwhile flag:\n\tif a[i]*2 > a[i+1]:\n\t\tflag = 0\t\n\telse:\n\t\tt = i\n\t\ti += 1\n\t\t\nprint(N-t)\n\t\t', 'N = int(input())\na = input().split()\nfor i in range(0,N):\n\ta[i] = int(a[i])\na.sort()\nt = 0\nflag = 1\nsum_a = 0\nfor i in range(0,N):\n\tsum_a += a[i]\n\tif sum_a*2 < a[i]:\n\t\tt = i+1\n\n\t\t\t\nprint(N-t)', 'N = int(input())\na = input().split()\nfor i in range(0,N):\n\ta[i] = int(a[i])\na.sort()\nt = 0\nflag = 1\nsum_a = 0\nfor i in range(0,N-1):\n\tsum_a += a[i]\n\tif sum_a*2 < a[i+1]:\n\t\tt = i+1\n\n\t\t\t\nprint(N-t)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s262744698', 's957504479', 's526218201']
[11152.0, 11204.0, 11372.0]
[96.0, 127.0, 130.0]
[191, 191, 195]
p03786
u064408584
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n=int(input())\na=list(map(int, input().split()))\na.sort(reverse=True)\nb=[0]\nfor i in a:\n b.append(i+b[-1])\nans=1\nfor i in range(1,n):\n print(b[i]-b[i-1],(b[-1]-b[i]))\n if b[i]-b[i-1]<=2*(b[-1]-b[i]):\n ans+=1\n else:break\nprint(ans)', 'n=int(input())\nt=sorted(map(int, input().split()),reverse=True)\nsm=sum(t)\nans=0\nfor i in t:\n sm-=i\n ans+=1\n if i>sm*2:\n break\nprint(ans)']
['Wrong Answer', 'Accepted']
['s879066910', 's761315675']
[14532.0, 14320.0]
[308.0, 104.0]
[249, 152]
p03786
u065446124
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n=int(input())\na=list(map(int,input().split()))\na.sort()\nl=0\nh=n-1\nwhile l<h:\n t=(l+h)//2\n b=sum(a[:t+1])\n if b*2>=a[-1]:\n h=t\n break\n for i in range(t+1,n):\n if b*2<a[i]:\n l=t+1\n break\n b+=a[i]\n else:\n h=t\nprint(n-l)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\nl=0\nh=n-1\nwhile l<h:\n t=(l+h)//2\n b=sum(a[:t+1])\n for i in range(t+1,n):\n if b*2>=a[-1]:\n h=t\n break\n if b*2<a[i]:\n l=t+1\n break\n b+=a[i]\n else:\n h=t\nprint(n-l)']
['Wrong Answer', 'Accepted']
['s501434804', 's189423712']
[14308.0, 14320.0]
[99.0, 127.0]
[289, 301]
p03786
u073852194
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['5\n1 1 1 1 1', 'N = int(input())\nA = list(map(int,input().split()))\n\nA.sort()\n\nB = [0 for _ in range(N)]\nb = 0\nfor i in range(N):\n b += A[i]\n B[i] = b\n\nans = 1\nfor i in range(N-1):\n if 2*B[i]>=A[i+1]:\n ans += 1\n else:\n ans = 1\n \nprint(ans)']
['Runtime Error', 'Accepted']
['s247645446', 's850835444']
[2940.0, 14228.0]
[17.0, 140.0]
[11, 256]
p03786
u089142196
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['N=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\nB=[A[0]]\nfor i in range(1,N):\n B.append(B[-1]+A[i])\n#print(A)\n\n\nleft=0\nfor left in range(N-2,-1,-1):\n if B[left]*2>=A[left+1]:\n pass\n else:\n break\n\nnum=N-left-1\n#print(left)\n#print(num)\n\n#cnt=0\n\n# if A[num]', 'N=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\nB=[A[0]]\nfor i in range(1,N):\n B.append(B[-1]+A[i])\nprint(A)\nprint(B)\n\nleft=0\nfor left in range(N-2,-1,-1):\n if B[left]*2>=A[left+1]:\n pass\n else:\n break\n\nnum=N-left-1\nprint(num)\n\n#cnt=0\n\n# if A[num]', 'N=int(input())\nA=list(map(int,input().split()))\nA.sort()\n\nB=[A[0]]\nfor i in range(1,N):\n B.append(B[-1]+A[i])\n#print(A)\n\n\nleft=0\nfor left in range(N-2,-1,-1):\n if B[left]*2>=A[left+1]:\n pass\n else:\n break\nelse:\n left=-1\n\nnum=N-left-1\n#print(left)\nprint(num)\n\n#cnt=0\n\n# if A[num]']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s117755809', 's907092088', 's742598116']
[14252.0, 18860.0, 14320.0]
[122.0, 151.0, 121.0]
[308, 292, 323]
p03786
u131881594
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n=int(input())\na=list(map(int,input().split()))\na.sort()\ntemp=[a[0]]\nfor i in range(n-1): temp.append(a[i]+a[i+1])\na.sort(reverse=True)\ntemp.reverse()\nfor i in range(n-1):\n if a[i]>2*a[i-1] and a[i]>temp[i+1]: break\nprint(i)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\ntemp=[a[0]]\nfor i in range(n-1): temp.append(temp[i]+a[i+1])\na.sort(reverse=True)\ntemp.reverse()\nprint(a)\nprint(temp)\nflag=1\nfor i in range(n-1):\n if a[i]>2*a[i+1] and a[i]>2*temp[i+1]:\n flag=0\n print(i+1)\n break\nif flag: print(n)', 'n=int(input())\na=list(map(int,input().split()))\na.sort()\ntemp=[a[0]]\nfor i in range(n-1): temp.append(temp[i]+a[i+1])\na.sort(reverse=True)\ntemp.reverse()\nflag=1\nfor i in range(n-1):\n if a[i]>2*a[i+1] and a[i]>2*temp[i+1]:\n flag=0\n print(i+1)\n break\nif flag: print(n)']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s370954404', 's740120625', 's563628136']
[20652.0, 22724.0, 20432.0]
[106.0, 131.0, 105.0]
[227, 311, 290]
p03786
u134019875
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n = int(input())\nL = sorted(map(int, input().split()))\nS = [0] * n\nS[0] = L[0]\nfor i in range(n-1):\n S[i+1] = S[i] + L[i]\n if L[i+1] > 2 * S[i]:\n print(n - i)\n break\nelse:\n print(n)\n', 'n = int(input())\nL = sorted(map(int, input().split()))\nS = [0] * n\nS[0] = L[0]\ncnt = 1\nfor i in range(n-1):\n S[i+1] = S[i] + L[i+1]\n if L[i+1] <= 2 * S[i]:\n cnt += 1\n else:\n cnt = 1\nprint(cnt)\n']
['Wrong Answer', 'Accepted']
['s699570265', 's246470434']
[14252.0, 14224.0]
[134.0, 142.0]
[205, 216]
p03786
u201234972
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['from itertools import accumulate\nN = int( input())\nA = list( map( int, input().split()))\nA.sort()\nl = -1\nr = N-1\nB = list( accumulate(A))\nwhile r - l > 1:\n m = (l+r)//2\n # now = sum(A[:m+1])\n check = 1\n for i in range(m+1,N):\n if B[i] <= now*2:\n pass\n else:\n check = 0\n break\n if check == 1:\n r = m\n else:\n l = m\nprint(N-r)', 'from itertools import accumulate\nN = int( input())\nA = list( map( int, input().split()))\nA.sort()\nl = -1\nr = N-1\nB = list( accumulate(A))\nwhile r - l > 1:\n m = (l+r)//2\n # now = sum(A[:m+1])\n check = 1\n for i in range(m+1,N):\n if A[i] <= B[i-1]*2:\n pass\n else:\n check = 0\n break\n if check == 1:\n r = m\n else:\n l = m\nprint(N-r)']
['Runtime Error', 'Accepted']
['s819980082', 's455228493']
[14432.0, 14428.0]
[86.0, 453.0]
[402, 405]
p03786
u241159583
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n = int(input())\na = list(map(int, input().split()))\na.sort()\ncnt = 0\nfor i in range(n):\n cnt += a[i]\n if cnt*4 >= max(a): break\n if cnt * 2 >= max(a): break\nprint(n-i)', 'n = int(input())\na = sorted(list(map(int, input().split())))\n\nans = -1\nfor i in range(n-1):\n if a[i]*2 < a[i+1]:\n ans = i\n a[i+1] += a[i]\nprint(n-ans-1)']
['Wrong Answer', 'Accepted']
['s975792491', 's652364378']
[14252.0, 14252.0]
[2104.0, 118.0]
[177, 165]
p03786
u291988695
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n=int(input())\ni=list(map(int,input().split()))\ni.sort()\ntemp=1\nsize=i[0]\nfor k in range(1,n):\n if size*2>=i[k]:\n temp+=1\n size+=i[k]\n else:\n temp=1\nprint(temp)\n', 'n=int(input())\ni=list(map(int,input().split()))\ni.sort()\ntemp=1\nsize=i[0]\nfor k in range(1,n):\n if size*2>=i[k]:\n temp+=1\n size+=i[k]\n else:\n temp=1\n size+=i[k]\nprint(temp)\n']
['Wrong Answer', 'Accepted']
['s472415829', 's317220487']
[14320.0, 14396.0]
[113.0, 118.0]
[172, 187]
p03786
u413165887
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n = int(input())\na = list(map(int, input().split()))\na.sort()\nb = [0]\nfor i in range(n-1):\n b.append(b[-1]+a[i])\n\nprint(b)\nresult = 1\nfor i in range(1, n+1):\n if b[-i]*2 < a[-i]:\n break\n result += 1\nprint(result)', 'n = int(input())\na = list(map(int, input().split()))\na.sort()\nb = [0]\nfor i in range(n-1):\n b.append(b[-1]+a[i])\nresult = 1\nfor i in range(1, n+1):\n if b[-i]*2 < a[-i]:\n break\n result += 1\nprint(result)']
['Wrong Answer', 'Accepted']
['s384827191', 's262004924']
[17704.0, 14252.0]
[146.0, 134.0]
[228, 218]
p03786
u419963262
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['N = int(input())\nA = list(map(int, input().split()))\n\nA = sorted(A)\n\nwa = A[0] \ncnt = 1 \nfor i in range(1, N):\n if 2 * wa >= A[i]:\n cnt += 1\n else:\n cnt = 1\n wa += A[i]\n print(cnt)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nA = sorted(A)\n\nwa = A[0]\ncnt = 0\nfor i in range(1, N):\n if wa >= A[i]:\n cnt += 1\n else:\n cnt = 1\n wa += A[i]\nprint(cnt + 1)\n', 'N = int(input())\nA = list(map(int, input().split()))\n\nA = sorted(A)\n\nwa = A[0] \ncnt = 1 \nfor i in range(1, N):\n if 2 * wa >= A[i]:\n cnt += 1\n else:\n cnt = 1\n wa += A[i]\nprint(cnt)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s393727956', 's880158297', 's636857722']
[20392.0, 20664.0, 20464.0]
[126.0, 91.0, 91.0]
[328, 201, 333]
p03786
u442877951
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['from itertools import accumulate\n\nN = int(input())\nA = list(map(int,input().split()))\nA = sorted(A)\nS = [0]+list(accumulate(A))\nAS = [0]*N\ncount = 0\n\nfor i in range(N):\n AS[i] = A[i]+S[i]\n\nfor i in range(N):\n num = AS[i]\n for j in range(i+1,N):\n print(A[j])\n if num*2 >= A[j]:\n num += A[j]\n if j == N-1:\n ans = len(A)-count\n print(ans)\n exit()\n else:\n count += 1\n break\n', 'from itertools import accumulate\n\nN = int(input())\nA = list(map(int,input().split()))\nA = sorted(A)\nS = list(accumulate(A))\nAS = []\nflg = False\ncount = 0\n\nfor i in range(N-1):\n AS.append(S[i]*2 - A[i+1])\nfor j in range(N-2,-1,-1):\n if AS[j] < 0:\n count = j+1\n break\nprint(len(A)-count)']
['Wrong Answer', 'Accepted']
['s252037295', 's259359276']
[27228.0, 16092.0]
[2104.0, 128.0]
[423, 293]
p03786
u517447467
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['import numpy as np\nN = int(input())\nM = [0] + sorted(list(map(int, input().split())))\nC = np.cumsum(M)\n#print(M, C)\n\ncount = 0\nfor i in range(N):\n print(M[i], C[i+1])\n if C[i]*2 >= M[i+1]:\n count += 1\nprint(count)', 'import numpy as np\nN = int(input())\nM = [0] + sorted(list(map(int, input().split())))\nC = np.cumsum(M)\n#print(M, C)\n\ncount = 0\nfor i in range(N):\n #print(M[i], C[i+1])\n if C[i]*2 >= M[i+1]:\n count += 1\nprint(count)\n', 'import numpy as np\nN = int(input())\nM = [0] + sorted(list(map(int, input().split())))\nC = np.cumsum(M)\n#print(M, C)\n\nfor i in range(N-1, -1, -1):\n #print(M[i], C[i+1])\n if C[i]*2 < M[i+1]:\n #print(i)\n break\nprint(N-i)\n']
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s556666986', 's933709058', 's418845195']
[23352.0, 23352.0, 23120.0]
[1067.0, 445.0, 405.0]
[267, 269, 270]
p03786
u518042385
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n=int(input())\nl=sorted(list(map(int,input().split())))\ncount=0\nsum=n\nnow=l[0]\nfor i in range(1,n):\n if now*2<l[i]:\n sum-=count\n now=now+l[i]\n count=0\n else:\n count+=1\n now+=l[i]\nprint(sum)\n', 'n=int(input())\nl=sorted(list(map(int,input().split())))\ncount=1\nsum=n\nnow=l[0]\nfor i in range(1,n):\n if now*2<l[i]:\n sum-=count\n now=now+l[i]\n count=1\n else:\n count+=1\n now+=l[i]\nprint(sum)']
['Wrong Answer', 'Accepted']
['s704237747', 's870213276']
[14308.0, 14320.0]
[116.0, 114.0]
[207, 206]
p03786
u520158330
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['N = int(input())\n\nA = sorted(list(map(int,input().split())),reverse=True)\nB = [sum(A[i:]) for i in range(N)]\n\nmin_abs = A[0]\nans = 1\nfor i in range(1,N):\n if A[i]*2 >= min_abs:\n ans += 1\n elif B[i]*2 >= min_abs:\n ans += 1\n else:\n break\n min_abs = A[i]\n \nprint(ans,A,B)', 'N = int(input())\n\nA = sorted(list(map(int,input().split())),reverse=True)\n\nmin_abs = A[0]\nans = 1\nfor i in range(1,N):\n if A[i]*2 >= min_abs:\n ans += 1\n elif sum(A[i:])*2 >= min_abs:\n ans += 1\n else:\n break\n min_abs = A[i]\n \nprint(ans)']
['Wrong Answer', 'Accepted']
['s243806652', 's605337875']
[14308.0, 14320.0]
[2104.0, 105.0]
[304, 271]
p03786
u536113865
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['f = lambda: map(int,input().split())\nn = int(input())\na = sorted(list(f()))\ns = [a[0]]\nfor i in range(n-1):\n s.append(s[-1]+a[i+1])\nfor i in range(2,n):\n if s[-i]*2<a[-i+1]:\n break\nprint(i-1)\n', 'f = lambda: map(int,input().split())\nn = int(input())\na = sorted(list(f()))\ns = [a[0]]\nfor i in range(n-1):\n s.append(s[-1]+a[i+1])\nans = 1\nfor i in range(2,n+1):\n if s[-i]*2<a[-i+1]:\n break\n ans += 1\nprint(ans)']
['Wrong Answer', 'Accepted']
['s991025659', 's304785069']
[14308.0, 14316.0]
[132.0, 140.0]
[205, 227]
p03786
u539517139
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n=int(input())\na=list(map(int,input().split()))\nb=[0]*n\nb[0]=a[0]\nfor i in range(1,n):\n b[i]=b[i-1]+a[i]\np=1\nfor i in range(n-1)[::-1]:\n if b[i]*2>=a[i+1]:\n p+=1\n else:\n break\nprint(p)', 'n=int(input())\na=sorted(list(map(int,input().split())))\nb=[0]*n\nb[0]=a[0]\nfor i in range(1,n):\n b[i]=b[i-1]+a[i]\np=1\nfor i in range(n-1)[::-1]:\n if b[i]*2>=a[i+1]:\n p+=1\n else:\n break\nprint(p)']
['Wrong Answer', 'Accepted']
['s117251092', 's187503010']
[14320.0, 14252.0]
[98.0, 133.0]
[193, 201]
p03786
u543954314
2,000
262,144
Snuke found N strange creatures. Each creature has a fixed color and size. The color and size of the i-th creature are represented by i and A_i, respectively. Every creature can absorb another creature whose size is at most twice the size of itself. When a creature of size A and color B absorbs another creature of size C and color D (C \leq 2 \times A), they will merge into one creature of size A+C and color B. Here, depending on the sizes of two creatures, it is possible that both of them can absorb the other. Snuke has been watching these creatures merge over and over and ultimately become one creature. Find the number of the possible colors of this creature.
['n = int(input())\na = sorted(list(map(int, input().split())),reverse=True)\nmintot = sum(a)\ncnt = 1\nfor i in range(n):\n tot -= a[i]\n if a[i] <= tot*2:\n break\n cnt += 1\nprint(cnt)', 'n = int(input())\na = sorted(list(map(int, input().split())),reverse=True)\ntot = sum(a)\ncnt = 1\nfor i in a:\n tot -= i\n if i > tot*2:\n break\n cnt += 1\nprint(cnt)']
['Runtime Error', 'Accepted']
['s401977605', 's357341699']
[14320.0, 14320.0]
[78.0, 105.0]
[182, 165]