s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s129336297
p03721
u371763408
1549904462
Python
Python (3.4.3)
py
Runtime Error
332
10596
233
n,k=map(int,input().split()) ls={} for i in range(n): a,b=map(int,input().split()) if a not in ls: ls[a]=b else: ls[a]+=b ls=sorted(ls.keys()) tmp=0 for i,j in ls.items(): tmp+=j if k <= tmp: print(i) exit()
s824300432
p03721
u538381753
1549152783
Python
Python (3.4.3)
py
Runtime Error
254
32148
188
n, k = [int(x) for x in input().split(' ')] ab = [(input().split(' ')) for _ in range(n)] index = 0 for a, b in ab: index += int(b) if index >= k: print(a) breaka
s178904691
p03721
u375616706
1548100819
Python
Python (3.4.3)
py
Runtime Error
2112
85944
758
import sys def input(): return sys.stdin.readline().strip() N, M = (list)(map(int, input().split())) edge = [] for _ in range(M): edge.append((list)(map(int, input().split()))) inf = 10**15 d = [inf]*(N+1) d[1] = 0 ans = inf for i in range(N): update = False for a, b, c in edge: c = -c ...
s282937164
p03721
u077337864
1545678640
Python
Python (3.4.3)
py
Runtime Error
17
3060
214
N, K = map(int, input().strip().split()) ab = [] for _ in range(N): ab.append(tuple(map(int, input().strip()))) kc = 0 for a, b in sorted(ab, key=lambda x: x[0]): if kc + b >= K: break kc += b print(a)
s400753778
p03721
u887207211
1545363955
Python
Python (3.4.3)
py
Runtime Error
327
27352
248
N, K = map(int,input().split()) A = [list(map(int,input().split())) for _ in range(N)] result = [a for j in range(b) for a, b in A] print(result[K+1]) """ result = [] for a, b in A: for j in range(b): result.append(a) print(result[K-1]) """
s398927805
p03721
u513081876
1542902949
Python
Python (3.4.3)
py
Runtime Error
2749
697204
232
n, k = map(int, input().split()) check = 0 ans = [] for i in range(n): a, b = map(int, input().split()) check += b ans.append(str(a)*b) if check >= k: ans = "".join(ans) print(ans[k-1]) break
s966941106
p03721
u513081876
1542900207
Python
Python (3.4.3)
py
Runtime Error
18
3572
213
n, k = map(int, input().split()) check = 0 ans = [] for i in range(n): a, b = map(int, input().split()) check += b ans.append(str(a)*b) if check <= k: ans = "".join(ans) print(ans[k-1]) break
s428832055
p03721
u930862022
1541733816
Python
Python (3.4.3)
py
Runtime Error
18
3064
210
n, k = map(int,input().split()) a, b = [] for i in range(n): x, y = map(int,input().split()) a.append(x) b.append(y) count = 0 i = 0 while count < k: count = count + b[i] i = i + 1 print(a[i])
s699833423
p03721
u930862022
1541733648
Python
Python (3.4.3)
py
Runtime Error
18
3828
189
n, k = map(int,input().split()) a, b = [0]*n for i in range(n): a[i], b[i] = map(int,input().split()) count = 0 i = 0 while count < k: count = count + b[i] i = i + 1 print(a[i])
s232416316
p03721
u131405882
1541585381
Python
Python (3.4.3)
py
Runtime Error
382
27356
243
N, K = list(map(int, input().strip().split())) grid = [] k = 0 j = 0 for i in range(N): array = list(map(int, input().strip().split())) grid.append(array) for i in range(N): if k < K: k += grid[i-1][1] j += 1 print(str(grid[j][0])[K-k])
s469582738
p03721
u106297876
1541382072
Python
Python (3.4.3)
py
Runtime Error
360
19600
404
from collections import defaultdict N, K = map(int,input().split( )) a = [] b = [] for i in range(N): a_i, b_i = map(int, input().split( )) a.append(a_i) b.append(b_i) d = defaultdict(int) for i in range(N): if a[i] in d: d[a[i]] += b[i] else: d[a[i]] = b[i] d_sorted = sorted(d.items())...
s262825191
p03721
u106297876
1541370940
Python
Python (3.4.3)
py
Runtime Error
1880
134388
154
N, K = map(int,input().split( )) l = [] for i in range(N): a, b = map(int, input().split( )) l.append(b) print(l) if sum(l) > K-1: print(a) break
s561370112
p03721
u853900545
1541296211
Python
Python (3.4.3)
py
Runtime Error
509
27872
155
n,k = map(int,input().split()) a = sorted(list(map(int,input().split())) for i in range(n)) i = 0 while k > 0: k -= a[i][1] i += 1 print(a[i+1][0])
s517646304
p03721
u853900545
1541296155
Python
Python (3.4.3)
py
Runtime Error
514
27872
153
n,k = map(int,input().split()) a = sorted(list(map(int,input().split())) for i in range(n)) i = 0 while k > 0: k -= a[i][1] i += 1 print(a[i][0])
s963749142
p03721
u317892501
1540215857
Python
Python (3.4.3)
py
Runtime Error
2104
3188
166
n, k = map(int , input().split()) e = [] cnt = 0 for i in range(n): a, b = map(int, input().split()) for j in range(b): e.append(a) e.sort() print(e[k-1])
s269791636
p03721
u317892501
1540215820
Python
Python (3.4.3)
py
Runtime Error
17
2940
154
n, k = map(int , input().split()) e = [] cnt = 0 for i in range(n): a, b = map(int, input().split()) for j in range(b): e.append(a) e.sort() print(e[k-1])
s094476056
p03721
u603234915
1539966531
Python
Python (3.4.3)
py
Runtime Error
21
3188
445
def main(): len_s = 0 ans = -1 dic = {} N, K = map(int, input().split()) for _ in range(N): a, b = map(int, input().split()) if a not in dic: dic[a] = b else: dic[a] = b + dic[a].values dic = sorted(dic.items()) for key, value in dic: l...
s158279462
p03721
u513081876
1538182801
Python
Python (3.4.3)
py
Runtime Error
332
27352
197
N, K = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(N)] hikaku = 0 for i in range(N): hikaku += ab[i][1] if K <= ans: print(ab[i][0]) break
s121834270
p03721
u201234972
1537496236
Python
Python (3.4.3)
py
Runtime Error
20
4596
147
N, K = map( int, input().split()) A = [] for i in range(N): a, b = map( int, input().split()) A += [a]*b A = A.sort()[:K] print(A[K-1])
s654861775
p03721
u863076295
1536886665
Python
Python (3.4.3)
py
Runtime Error
17
2940
208
n,k = map(int,input()split()) d = [] for _ in range(n): d.append(list(map(int,input().split()))) d.sort(key=lambda x: x[0]) count = 0 for x,y in d: count += y if count >= k: break print(x)
s807918434
p03721
u136395536
1535112459
Python
Python (3.4.3)
py
Runtime Error
531
21248
338
N,K = (int(i) for i in input().split()) numbers = [] for i in range(N): a,b = (int(k) for k in input().split()) numbers.append([a,b]) numbers.sort(key = lambda x:x[0]) numbers.sort(key = lambda x:x[1]) #print(numbers) kugiri = numbers[0][1] i = 0 while K >= kugiri: i += 1 kugiri += numbers[i][1] pr...
s931963148
p03721
u599547273
1533409655
Python
Python (3.4.3)
py
Runtime Error
2243
2087224
245
n, k = map(int, input().split(" ")) ab = [tuple(map(int, input().split(" "))) for i in range(n)] d = dict() for ab_i in ab: a, b = ab_i if a not in d: d[a] = 0 d[a] += b print(sum([[d_a] * d_b for d_a, d_b in sorted(d.items())], [])[k-1])
s916097564
p03721
u140251125
1530145134
Python
Python (3.4.3)
py
Runtime Error
17
3060
204
# input N, K = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(M)] count = 0 for i in range(N): count += A[i][1] if count >= K: print(A[i][0]) break
s286731288
p03721
u400620139
1529810834
Python
Python (3.4.3)
py
Runtime Error
360
11440
209
n, k = map(int, input().split()) v = [] w = [] for i in range(n) : s, t = map(int, input().split()) v.append(s) w.append(t) v.sort() i=int(0) while k-w[i] >= 0 : k-=w[i] i+=1 print(v[i])
s329597856
p03721
u503901534
1524664154
Python
Python (3.4.3)
py
Runtime Error
17
3064
377
n, k = map(int,input().split()) dcic = {} aa = () for i in range(n): a,b = map(int,input().split()) aa.add(a) if a in dcic: dcic[a] = dcic + b else: dcic.update({a:b}) bb = list(sorted(list(aa))) cc = 0 for i in range(len(bb)): if k - dcic[bb[i]] > -1: k = k - dcic[bb[i]] ...
s270808006
p03721
u200239931
1524622586
Python
Python (3.4.3)
py
Runtime Error
3311
990468
687
import math import sys def getinputdata(): # 配列初期化 array_result = [] data = input() array_result.append(data.split(" ")) flg = 1 try: while flg: data = input() array_temp = [] if(data != ""): array_re...
s066586976
p03721
u329865314
1524094563
Python
Python (3.4.3)
py
Runtime Error
17
2940
176
tmp = list(map(int,input().split())) n, k = tmp[0],tmp[1] an = [] for i in range(n): tmp = list(map(int,input().split())) an += [tmp[0]] * tmp[1] an.sort() print(an[k-1])
s299552078
p03721
u653005308
1521673878
Python
Python (3.4.3)
py
Runtime Error
2681
995040
139
n,k=map(int,input().split()) list=[] for i in range(n): a,b=map(int,input().split()) list.append(str(a)*b) list.sort print(list[k])
s771315139
p03721
u030726788
1520298836
Python
Python (3.4.3)
py
Runtime Error
47
13172
240
import sys n,k=map(int,input().split()) ab=[[0,0]for i in range(n)] for i in range(n): ab[i][0],ab[i][1]=map(int,input.split()) ab.sort() x=0 for i in range(n): x+=ab[i][1] if(x>=k): print(ab[i][0]) sys.exit() print(ab[-1][0])
s919323597
p03721
u143492911
1518815946
Python
Python (3.4.3)
py
Runtime Error
2729
2068340
188
n,k=map(int,input().split()) ans=[] ans_i=[] num="" for i in range(n): a,b=map(int,input().split()) ans.append(str(a)*b) for j in ans: num+=j ans_i=list(num) print(ans_i[k-1])
s368729181
p03721
u486232694
1515563080
Python
Python (3.4.3)
py
Runtime Error
17
2940
533
#include<iostream> #include<map> #include<vector> #include<algorithm> using namespace std; long long int N, K; long long int a, b; int main(){ cin >> N >> K; vector<pair<long long int, long long int> > pairs(N); for(int i = 0; i < N; i++){ cin >> a >> b; pairs[i] = make_pair(a, b); }...
s171559980
p03721
u863370423
1511886817
Python
Python (3.4.3)
py
Runtime Error
17
3060
171
n = int(input()) k = int(input()) x = 0 y =0 sum = 0 for i in range(n): x=int(input()) y = int(input()) sum+=y if(k <= sum): print(x) break
s799452790
p03721
u863370423
1511885082
Python
Python (3.4.3)
py
Runtime Error
18
2940
245
args = raw_input().split() sarr = [] for i in range(int(args[0])): sarr.append(raw_input().split()) counter = 0 lim = int(args[1]) for i in sarr: counter += int(i[1]) if(counter >= lim): print(int(i[0])) exit()
s361033133
p03721
u353919145
1511883477
Python
Python (3.4.3)
py
Runtime Error
18
2940
687
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <queue> #include <cstring> #include <iterator> #include <list> #include <set> #include <map> #include <bitset> using namespace std; int main() { int N, K; cin >> N >> K...
s453857644
p03721
u353919145
1511883311
Python
Python (3.4.3)
py
Runtime Error
1982
176336
416
inp = input().split(" ") N = int(inp[0]) K = int(inp[1]) arr = [] indicies = [0] for i in range(N): inp = input().split(" ") a = int(inp[0]) b = int(inp[1]) if len(arr) == 0 or a >= arr[-1]: arr += [a] * b indicies.append(len(arr)) elif a <= arr[0]: arr = ([a] * b) + arr else: for i in indicies: if a...
s950279741
p03721
u018679195
1511883174
Python
Python (3.4.3)
py
Runtime Error
17
2940
634
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <queue> #include <cstring> #include <iterator> #include <list> #include <set> #include <map> #include <bitset> using namespace std; int main() { int N, K; cin >> N >> K...
s843020953
p03721
u010110540
1504750393
Python
Python (3.4.3)
py
Runtime Error
17
3060
124
10 500000 1 100000 1 100000 1 100000 1 100000 1 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000 100000
s932826042
p03721
u364386647
1504206521
Python
Python (3.4.3)
py
Runtime Error
2106
208700
320
from collections import deque N, K = map(int, input().split()) a = [0] * N b = [0] * N x = deque() y = deque() for i in range(N): a[i], b[i] = map(int, input().split()) for i in range(N): if len(y) <= K: x = [1 * a[i]] * b[i] y.extend(x) print(y) else: break print(y[K-1])
s780548147
p03721
u364386647
1504206463
Python
Python (3.4.3)
py
Runtime Error
2107
211288
319
from collections import deque N, K = map(int, input().split()) a = [0] * N b = [0] * N x = deque() y = deque() for i in range(N): a[i], b[i] = map(int, input().split()) for i in range(N): if len(y) < K: x = [1 * a[i]] * b[i] y.extend(x) print(y) else: break print(y[K-1])
s133973243
p03721
u762008592
1503686433
Python
Python (3.4.3)
py
Runtime Error
2112
135956
277
em=[] N,K=[int(i) for i in input().split()] c_n=[int(i) for k in range(N) for i in input().split()] a_n=[] b_n=[] for i in range(N): a_n.append(c_n[2*i]) b_n.append(c_n[2*i+1]) for i in range(N): for j in range(b_n[i]): em.append(a_n[i]) print(c_n[K-1])
s172767365
p03721
u839537730
1501430260
Python
Python (3.4.3)
py
Runtime Error
367
10604
308
N, K = list(map(int, input().split(" "))) d = dict() for i in range(N): a, b = list(map(int, input().split(" "))) if a in d: d[a] = d[a] + b else: d[a] = b ans_sum = 0 for key in sorted(d.keys()): ans_sum += d[key] if (ans_sum) >= K: print(k) break
s166762102
p03721
u343437894
1499526254
Python
Python (3.4.3)
py
Runtime Error
22
3888
184
n, k = map(int, input().split(" ")) nums=[] for i in range(0, n): a, b = map(int, input().split(" ")) nums.extend = [a for i in range(0, b)] nums.sort() print(nums[k-1])
s496496078
p03721
u343437894
1499526254
Python
Python (3.4.3)
py
Runtime Error
22
3888
184
n, k = map(int, input().split(" ")) nums=[] for i in range(0, n): a, b = map(int, input().split(" ")) nums.extend = [a for i in range(0, b)] nums.sort() print(nums[k-1])
s681977297
p03721
u830390742
1497887966
Python
Python (2.7.6)
py
Runtime Error
10
2568
287
A = [0 for _ in xrange(10**5+10)] N, K = map(int, raw_input().split()) for i in xrange(N): a, b = map(int, raw_input().split()) A[a] += b k = 0 for i in xrange(10**5+10): k += A[i] if k >= K: print i break
s072198989
p03721
u190525112
1496537583
Python
Python (3.4.3)
py
Runtime Error
17
2940
201
for i in range(x[0]+1): a, b= map(int , input().split()) v[a]+=b diffK=x[1] for i in range(1,x[0]+1): if diffK-v[i]<=0: print(i) quit() else: diffK -=v[i]
s127881979
p03721
u190525112
1496537093
Python
Python (3.4.3)
py
Runtime Error
17
2940
251
x = list(map(int, input().split())) v=[0]*(10**5+1) for i in range(x[0]): a, b= map(int , input().split()) v(a)+=b diffK=x[1] for i in range(x[0]): if diffK-i[1]<=0: print(i[0]) quit() else: diffK -=i[1]
s040171875
p03721
u351527281
1495249888
Python
Python (3.4.3)
py
Runtime Error
3101
1060888
170
n,k=map(int,input().split()) string = '' for i in range(n): a,b=(input().split()) string += a*int(b) string = [int(i) for i in string] print(sorted(string)[k-1])
s860535677
p03721
u351527281
1495249603
Python
Python (3.4.3)
py
Runtime Error
3430
1063448
169
n,k=map(int,input().split()) string = '' for i in range(n): a,b=(input().split()) string += a*int(b) string = [int(i) for i in string] print(sorted(string[k-1]))
s978215755
p03721
u351527281
1495248106
Python
Python (3.4.3)
py
Runtime Error
17
3060
127
n,k=map(int,input().split()) string = '' for i in range(N): a,b=(input().split()) string += a*int(b) print(string[k-1])
s946084275
p03721
u859491652
1494949937
Python
Python (3.4.3)
py
Runtime Error
17
2940
433
# N,Kの把握 l1 = list(map(int, input().split())) N = l1[0] K = l1[1] #空リストを作成。a,bを把握し、リストにaを追加、b回。これをN回くりかえし l3 = [] for i in range(N): l2 = list(map(int, input().split())) a = l2[0] b = l2[1] if b <= K: for j in range(b): l3.append(a): else for j in range(K): l3.append(a) # リストをソートし、K番目を出力 l3.sort() prin...
s710622124
p03721
u521271286
1494893862
Python
Python (3.4.3)
py
Runtime Error
2221
1925860
145
n, k = map(int, input().split()) x = [] for i in range(0, n): a, b = map(int, input().split()) x.append([a] * b) x.sort() print(x[k-1])
s979080804
p03721
u818050295
1494891886
Python
Python (3.4.3)
py
Runtime Error
316
5916
305
tmp = input().split(" ") N = int(tmp[0]) K = int(tmp[1]) num = [0 for i in range(N)] for i in range(N): tmp = input().split(" ") a = int(tmp[0]) b = int(tmp[1]) num[a-1] = num[a-1] + b tmp = 0 i = 0 while tmp < K: tmp = tmp + num[i] if tmp >= K: print(i+1) i = i + 1
s757020318
p03721
u818050295
1494891788
Python
Python (3.4.3)
py
Runtime Error
301
5916
310
tmp = input().split(" ") N = int(tmp[0]) K = int(tmp[1]) num = [0 for i in range(N-1)] for i in range(N-1): tmp = input().split(" ") a = int(tmp[0]) b = int(tmp[1]) num[a-1] = num[a-1] + b tmp = 0 i = 0 while tmp <= K: tmp = tmp + num[i] if tmp >= K: print(i+1) i = i + 1
s954183227
p03721
u818050295
1494891697
Python
Python (3.4.3)
py
Runtime Error
298
5916
308
tmp = input().split(" ") N = int(tmp[0]) K = int(tmp[1]) num = [0 for i in range(N-1)] for i in range(N): tmp = input().split(" ") a = int(tmp[0]) b = int(tmp[1]) num[a-1] = num[a-1] + b tmp = 0 i = 0 while tmp <= K: tmp = tmp + num[i] if tmp >= K: print(i+1) i = i + 1
s720159273
p03721
u818050295
1494891186
Python
Python (3.4.3)
py
Runtime Error
310
5924
306
tmp = input().split(" ") N = int(tmp[0]) K = int(tmp[1]) num = [0 for i in range(N)] for i in range(N): tmp = input().split(" ") a = int(tmp[0]) b = int(tmp[1]) num[a-1] = num[a-1] + b tmp = 0 i = 0 while tmp <= K: tmp = tmp + num[i] if tmp >= K: print(i+1) i = i + 1
s090247097
p03721
u009102496
1494888413
Python
Python (3.4.3)
py
Runtime Error
507
28640
314
a,b=map(int,input().split()) alllist=[] goukei=0 for i in range(a): tmplist=list(map(int,input().split())) alllist.append(tmplist) alllist2=sorted(alllist) for i in range(a): goukei=alllist2[i][1]+goukei if goukei>b: owari=alllist2[i][0] break else: pass print(owari)
s071856629
p03721
u009102496
1494888201
Python
Python (3.4.3)
py
Runtime Error
448
28640
306
a,b=map(int,input().split()) alllist=[] goukei=0 for i in range(a): tmplist=list(map(int,input().split())) alllist.append(tmplist) sorted(alllist) for i in range(a): goukei=alllist[a][1]+goukei if goukei>b: owari=alllist[a][0] break else: pass print(owari)
s801776269
p03721
u009102496
1494887499
Python
Python (3.4.3)
py
Runtime Error
293
3060
198
a,b=map(int,input().split()) goukei=0 for i in range(a): aN,bN=map(int,input().split()) goukei=bN+goukei if goukei>b: owari=aN break else: pass print(owari)
s089770697
p03721
u706884679
1494774911
Python
Python (3.4.3)
py
Runtime Error
375
32604
174
N, K = map(int, input().split()) c = [] for i in range(N): c.append(input().split()) c.sort() f = 0 for i in range(N): f += c[i][1] if f >= K: print(c[i][0]) break
s020894520
p03721
u706884679
1494773748
Python
Python (3.4.3)
py
Runtime Error
306
33864
192
N, K = map(int, input().split()) c = [] for i in range(N): c.append(input().split()) c.sort(key=lambda x: x[0]) f = 0 for i in range(N): f += c[i][1] if f >= K: print(c[i][0]) break
s645893038
p03721
u341926204
1494740271
Python
Python (3.4.3)
py
Runtime Error
17
3060
238
n, k = map(int, input().split()) U = [] for i in range(n): U.append(tuple(map(int, input().split()))) sorted(U, key=lambda i: i[0]) # print(U) for i in U: k -= i[1] print(i, k) if k <= 0: print(i[0]) return
s241526089
p03721
u087996506
1494738922
Python
Python (2.7.6)
py
Runtime Error
258
4868
266
# -*- coding: utf-8 -*- # スペース区切りの整数の入力 N, K = map(int, raw_input().split()) R = [0] * (10**5) for i in xrange(N): ia, ib = map(int, raw_input().split()) R[ia] += ib k = 0 c = 0 while k < K: c += 1 k += R[c] print c
s457801412
p03721
u087996506
1494734859
Python
Python (2.7.6)
py
Runtime Error
2613
1646208
285
# -*- coding: utf-8 -*- # スペース区切りの整数の入力 import numpy as np N, K = map(int, raw_input().split()) def test(): ia, ib = map(int, raw_input().split()) return np.ones(ib) * ia R = np.array([test() for i in xrange(N)]) print int(np.sort(R.flatten())[K-1])
s194069581
p03721
u049297964
1494734589
Python
Python (3.4.3)
py
Runtime Error
215
32168
201
N,K = map(int, input().split()) c = [] for i in range(N): c.append(input().split()) d = [] e = [] for j in range(N): e.append(c[j][0]) e = e * c[j][1] d = d + e e = [] d.sort() print(d[K-1])
s216062886
p03721
u049297964
1494733979
Python
Python (3.4.3)
py
Runtime Error
357
49680
429
#N,Kの取得 N,K = list(map(int,input().split())) #[(a_1,b_1),(a_2,b_2),...]の形でリストを作成 numList = [ map(int,input().split()) for _ in range(N) ] #作成したリストを、aの大きさで昇順ソート numList = sorted(numList,key=lambda x:x[0]) #小さい順に要素数bを足していき、Kを超えた段階で出力、終了 count = 0 for a,b in numList: count += b if count>=K: print(a) quit()
s094814673
p03721
u087996506
1494733621
Python
Python (2.7.6)
py
Runtime Error
380
16780
401
# -*- coding: utf-8 -*- # スペース区切りの整数の入力 import numpy as np N, K = map(int, raw_input().split()) R = [] for i in xrange(K): ia, ib = map(int, raw_input().split()) R.extend([ia, ib]) R = sorted(R) R.reverse() count = 1 c = 0 r = R.pop() for i in xrange(N): while count == r and len(R) > 0: c += 1 ...
s504960471
p03721
u341087021
1494733475
Python
Python (3.4.3)
py
Runtime Error
301
14784
271
import sys import numpy as np import collections r = [0]*100000 n,k = [int(x) for x in sys.stdin.readline().split()] for i in range(n): a, b = [int(x) for x in sys.stdin.readline().split()] r[a] += b c = 0 for i,j in enumerate(r): c += j if c >= k: print(i) break
s814869884
p03721
u341087021
1494732818
Python
Python (3.4.3)
py
Runtime Error
616
13184
276
import sys import numpy as np import collections n,k = [int(x) for x in sys.stdin.readline().split()] r = np.zeros(10**5) for i in range(n): a, b = [int(x) for x in sys.stdin.readline().split()] r[a] += b c = 0 for i,j in enumerate(r): c += j if c >= k: print(i) break
s220362216
p03721
u048744861
1494732385
Python
Python (2.7.6)
py
Runtime Error
10
2568
330
n,k = map(int,raw_input().split()) l = [] s = list() for i in range(n): v,count = map(int,raw_input().split()) l.append((count,v)) sorted(l, key=lambda x: x[1]) countTmp = 0 for count,v in l: count >= k: print v break countTmp = countTmp + count if k <= countTmp: print v ...
s078665478
p03721
u833882954
1494731997
Python
Python (3.4.3)
py
Runtime Error
869
19760
260
import numpy as np N, K = list(map(int, input().split(' '))) L = np.zeros(N).astype(int) for _ in range(N): a, b = list(map(int, input().split(' '))) L[a-1] += b tot = 0 for i in range(N): tot += L[i] if tot >= K: break print(i+1)
s886173748
p03721
u833882954
1494731748
Python
Python (3.4.3)
py
Runtime Error
852
13272
268
import numpy as np N, K = list(map(int, input().split(' '))) L = np.zeros(N).astype(int) for _ in range(N): a, b = list(map(int, input().split(' '))) L[a-1] += b tot = 0 for i in range(N): tot += L[i] if tot >= K: print(i+1) break
s363322665
p03721
u833882954
1494731681
Python
Python (3.4.3)
py
Runtime Error
861
13268
266
import numpy as np N, K = list(map(int, input().split(' '))) L = np.zeros(N).astype(int) for _ in range(N): a, b = list(map(int, input().split(' '))) L[a-1] += b tot = 0 for i in range(N): tot += L[i] if tot >= K: print(i) break
s749597574
p03721
u590905793
1494730177
Python
Python (3.4.3)
py
Runtime Error
501
20096
220
n,k = map(int,input().split()) ls = [] for i in range(n): a,b = [int(i) for i in input().split()] ls.append([a,b]) ls.sort() for a,b in ls: if b >= k: print(x) break else: k -= b
s813014410
p03721
u341087021
1494729780
Python
Python (3.4.3)
py
Runtime Error
335
23584
317
import sys import numpy as np import collections n,k = [int(x) for x in sys.stdin.readline().split()] r = collections.defaultdict(int) for i in range(n): a, b = [int(x) for x in sys.stdin.readline().split()] r[a] += b d = sorted(r.items()) c = 0 for i,j in enumerate(d): c += j if c >= k: print(int(i)) break
s894264488
p03721
u348795830
1494729716
Python
Python (2.7.6)
py
Runtime Error
396
20828
226
import numpy as np n,k=map(int,raw_input().split()) a=[] b=[] for i in range(n): aa,bb=map(int,raw_input().split()) a.append(aa) b.append(bb) a=np.array(a) b=np.array(b) c=np.cumsum(b) z=c[c<k] print(a[z[-1]-1])
s105142768
p03721
u888275483
1494729685
Python
Python (2.7.6)
py
Runtime Error
451
23300
327
#!/usr/bin/env python # -*- coding: utf-8 -*- array = [] hoge = [] n, k = map(int, raw_input().split()) for i in xrange(n): a, b = map(int, raw_input().split()) array.append([a, b]) array.sort() print(array) for i in range(len(array)): hoge += array[i][0] * array[i][1] if len(hoge) >= k: break print(hoge[k...
s946411416
p03721
u238510421
1494729598
Python
Python (3.4.3)
py
Runtime Error
451
30836
287
import numpy as np n,k = input().split() n = int(n) k = int(k) l = list() for i in range(n): a, b = input().split() l.append([int(a),int(b)]) ar = np.array(l) ar_s = ar.sort(0) count = np.cumsum(ar_s[:,1]) print(ar_s) print(count) print(int(ar_s[np.where(count >=k)[0][0]][0]))
s477700364
p03721
u590905793
1494729329
Python
Python (3.4.3)
py
Runtime Error
2242
570944
327
n,k = map(int,input().split()) ls = [] b_num = 0 for i in range(n): a,b = [int(i) for i in input().split()] if b_num < k: tmp = [a] * b ls.extend(tmp) #ls.sort() b_num += b else: if(a <= ls.max): tmp = [a] * b ls.extend(tmp) ls.sort() print(l...
s342975564
p03721
u341087021
1494728857
Python
Python (3.4.3)
py
Runtime Error
320
21276
297
import sys import numpy as np from collections import defaultdict as dd n,k = [int(x) for x in sys.stdin.readline().split()] r = dd(int) for i in range(n): a, b = [int(x) for x in sys.stdin.readline().split()] r[a] += b r.sort() c = 0 for i,j in r.items(): c += j if c >= k: print(i) break
s386407917
p03721
u682181971
1494728857
Python
Python (3.4.3)
py
Runtime Error
2104
134840
452
N,K = map(int, input().split()) ab_list = {} for i in range(N): a,b = map(int, input().split()) akagi=str(a) if akagi in ab_list: ab_list[akagi] += b print("if") print(ab_list) else: ab_list[akagi] = b print("else") print(ab_list) co...
s656892980
p03721
u888275483
1494728792
Python
Python (2.7.6)
py
Runtime Error
2195
1939520
287
#!/usr/bin/env python # -*- coding: utf-8 -*- array = [] hoge = [] n, k = map(int, raw_input().split()) for i in xrange(n): a, b = map(int, raw_input().split()) array.append(a) array.sort() for i in array: hoge += [array[i]] * b if len(hoge) >= k: break print(hoge[k - 1])
s915529643
p03721
u888275483
1494728754
Python
Python (2.7.6)
py
Runtime Error
10
2568
286
#!/usr/bin/env python # -*- coding: utf-8 -*- array = [] hoge = [] n, k = map(int, raw_input().split()) for i in xrange(n): a, b = map(int, raw_input().split()) array.append(a) array.sort() for i in array hoge += [array[i]] * b if len(hoge) >= k: break print(hoge[k - 1])
s566160941
p03721
u590905793
1494728238
Python
Python (3.4.3)
py
Runtime Error
321
14784
342
n,k = map(int,input().split()) ls = [] b_num = 0 for i in range(n): a,b = [int(i) for i in input().split()] if b_num <= b: tmp = [a] * b ls.extend(tmp) ls.sort b_num += b else: if(a < ls[-1]): tmp = [a] * b ls.extend(tmp) ls.sort ...
s082064260
p03721
u590905793
1494728016
Python
Python (3.4.3)
py
Runtime Error
313
14784
367
n,k = map(int,input().split()) ls = [] b_num = 0 for i in range(n): a,b = [int(i) for i in input().split()] if b_num <= b: tmp = [a] * b ls.extend(tmp) ls.sort b_num += b else: if(a < ls[-1]): tmp = [a] * b ls.extend(tmp) ls.sort ...
s088091810
p03721
u590905793
1494727867
Python
Python (3.4.3)
py
Runtime Error
2187
8532
399
n,k = map(int,input().split()) ls = [] b_num = 0 for i in range(n): a,b = [int(i) for i in input().split()] if b_num <= b: tmp = [a] * b ls.extend(tmp) ls.sort b_num += b else: if(a > ls[-1]): break else: tmp = [a] * b ls.e...
s591517241
p03721
u153729035
1494727535
Python
Python (3.4.3)
py
Runtime Error
2110
578556
268
import numpy as np N,K=list(map(int,input().split())) res=np.array([1000000]*K) for row in [list(map(int,input().split())) for _ in [1]*N]: for _ in [1]*int(row[1]): res.sort() if row[0]<res[K-1]:res[K-1]=row[0] res.sort() print(res[len(res)-1])
s761334209
p03721
u752982538
1494727401
Python
Python (2.7.6)
py
Runtime Error
2211
1430916
205
N, K = map(int, raw_input().split()) array=[10^5+1]*K for i in range(N): a,b=map(int, raw_input().split()) for j in range(K): if a<array[j] and 0<b: array[j]=a b=b-1 array.sort() print array[K-1]
s599212535
p03721
u590905793
1494727075
Python
Python (3.4.3)
py
Runtime Error
2221
1923820
179
n,k = map(int,input().split()) ls = [] for i in range(n): a,b = [int(i) for i in input().split()] tmp = [a] * b ls.append(tmp) ls = sum(ls,[]) ls.sort(k-1) print(ls)
s436572148
p03721
u049595114
1494726705
Python
Python (3.4.3)
py
Runtime Error
16
2940
278
N, K = [int(x) for x in input().split()] Array = list() A = list() count = 0 ans = 0 for i in range(N): A.append[int(x) for x in input().split()] A.sort(key=itemgetter(0), reverse=True) for i in range(N): count += A[1, i] if count >= K: ans = A[0, i] break print(ans)
s232910363
p03721
u341087021
1494726484
Python
Python (3.4.3)
py
Runtime Error
287
18912
273
import sys import numpy as np n,k = [int(x) for x in sys.stdin.readline().split()] r = np.array() for i in range(n): r[i] = [int(x) for x in sys.stdin.readline().split()] r.sort(key=lambda x:x[0]) c = 0 for i,j in enumerate(r): c += j[0] if c >= k: print(j[1]) break
s462154592
p03721
u790865353
1494726132
Python
Python (3.4.3)
py
Runtime Error
441
20104
252
N,K=map(int,input().split()) A=[] C=[] for i in range(N): a,b=map(int,input().split()) T=[a,b] A.append(T) A.sort() counter=0 for i in range(N): counter+=A[i][1] if counter>K: counter=i break print(A[counter][0])
s326506598
p03721
u817142576
1494726128
Python
Python (2.7.6)
py
Runtime Error
2114
194572
236
n, k = map(int, raw_input().split()) sum = 0 array = [] for i in range(n): a, b = map(int, raw_input().split()) sum += b if k <= sum: break for j in range(b): array.append(a) array.sort() print array[k]
s024907157
p03721
u790865353
1494725928
Python
Python (3.4.3)
py
Runtime Error
455
20092
254
N,K=map(int,input().split()) A=[] C=[] for i in range(N): a,b=map(int,input().split()) T=[a,b] A.append(T) A.sort() counter=0 for i in range(N): counter+=A[i][1] if counter>K: counter=i break print(A[counter-1][0])
s001975083
p03721
u667084803
1494725467
Python
Python (3.4.3)
py
Runtime Error
16
2940
424
import sys N,K=map(int, input().split()) p=[] for i in range (0,N): r=list(map(int, input().split() )) p.append(r) p.sort() k=0 for i in range(0,N): k+=p[i][0]] if k>=K: print(p[i][1]) sys.exit() import sys N,K=map(int, input().split()) p=[] for i in range (0,N): r=list(map(int, input().split() )) ...
s919290003
p03721
u533084327
1494725420
Python
Python (3.4.3)
py
Runtime Error
17
2940
259
mport numpy as np N,K = list(map(int,input().split())) a = [] array = np.array([]) for i in range(N): a = list(map(int,input().split())) array = np.concatenate((array,a[0]*np.ones(a[1]))) print (array) array = np.sort(array) print (int(array[K-1]))
s085227416
p03721
u820351940
1494725278
Python
Python (3.4.3)
py
Runtime Error
369
30204
300
n, k = map(int, input().split()) ab = [list(map(int, input().split())) for x in range(n)] tk = k ends = [0 for x in range(10**5)] for a, b in ab: ends[a] += b k -= b if k <= 0: break for i, e in enumerate(ends): tk -= e if tk <= 0: print(i) break
s546941417
p03721
u667084803
1494724941
Python
Python (3.4.3)
py
Runtime Error
18
2940
225
import sys N,K=map(int, input().split()) p=[] for i in range (0,N): r=list(map(int, input().split() )) p.append(r) p.sort() q=[] for i in range(0,N): q+=[p[i][0]]*p[i][1] if len(q)>K; print(q[K-1]) sys.exit()
s498430268
p03721
u888275483
1494724694
Python
Python (2.7.6)
py
Runtime Error
305
12164
221
#!/usr/bin/env python # -*- coding: utf-8 -*- array = [] n, k = map(int, raw_input().split()) for i in range(n): a, b = map(int, raw_input().split()) array.append(a) array.append(b) array.sort() print(array[k - 1])
s435774968
p03721
u254343015
1494724297
Python
Python (2.7.6)
py
Runtime Error
266
12164
252
N,K = map(int,raw_input().split()) a_list=[] b_list=[] count = 0 for i in range(N): a,b = map(int,raw_input().split()) a_list.append(a) b_list.append(b) for i in range(N): count+=b[i] if count>=K: print a[i] break
s350742651
p03722
u711539583
1600489079
Python
PyPy3 (7.3.0)
py
Runtime Error
138
75332
1691
INF = float('inf') N, M = map(int, input().split()) class Edge(): def __init__(self, start, end, cost): self.start = start self.end = end self.cost = cost def __str__(self): return 'Edge: {} -> {}, cost {}'.format(self.start, self.end, self.cost) def bellman_ford(n, es, s): ...