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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s158704267 | p03720 | u333139319 | 1550529420 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 350 | [n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
ab.append([int(j) for j in input().split()])
for i in range(m):
if ab[i][0] in dic.keys():
dic[ab[i][0]] += 1
else:
dic[ab[i][0]] = 1
if ab[i][1] in dic.keys():
dic[ab[i][1]] += 1
else:
dic[ab[i][1]] = 1
for i ... |
s191079812 | p03720 | u333139319 | 1550528853 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 354 | [n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
ab.append([int(j) for j in input().split()])
for i in range(m):
if ab[i][0] in dic.keys():
dic[ab[i][0]] += 1
else:
dic[ab[i][0]] = 1
if ab[i][1] in dic.keys():
dic[ab[i][1]] += 1
else:
dic[ab[i][1]] = 1
fo... |
s556146495 | p03720 | u333139319 | 1550528790 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 355 | [n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
ab.append([int(j) for j in input().split()])
for i in range(m):
if ab[i][0] in dic.keys():
dic[ab[i][0]] += 1
else:
dic[ab[i][0]] = 1
if ab[i][1] in dic.keys():
dic[ab[i][1]] += 1
else:
dic[ab[i][1]] = 1
f... |
s726265218 | p03720 | u333139319 | 1550528606 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 359 | [n,m] = [int(i) for i in input().split()]
ab = []
dic = {}
for i in range(m):
ab.append([int(i) for i in input().split()])
for i in range(m):
if ab[i][0] in dic.keys():
dic[ab[i][0]] += 1
else:
dic[ab[i][0]] = 1
if ab[i][1] in dic.keys():
dic[ab[i][1]] += 1
else:
dic[ab[i][1]] = 1
fo... |
s662325510 | p03720 | u977389981 | 1550170659 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 234 | from collections import Counter
n, m = map(int, input().split())
A = []
for i in range(m):
x, y = map(int, input().split())
A.append(x)
A.append(y)
C = sorted(Counter(A).most_common())
for i in range(n):
print(C[i][1]) |
s723981538 | p03720 | u977389981 | 1550170547 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3316 | 272 | from collections import Counter
n, m = map(int, input().split())
A = []
for i in range(m):
x, y = map(int, input().split())
A.append(x)
A.append(y)
C = sorted(Counter(A).most_common(), reverse = True, key = lambda x: x[1])
for i in range(n):
print(C[i][1]) |
s872617871 | p03720 | u928784113 | 1549908125 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 35 | 8 8
1 2
3 4
1 5
2 8
3 7
5 2
4 1
6 8 |
s767837107 | p03720 | u597374218 | 1546914522 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 118 | n,m=map(int,input().split())
l=" ".join([input() for _ in [0]*m])
for i in range(i,n+1):print(s.split().count(str(i))) |
s218145307 | p03720 | u941753895 | 1546507226 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 224 | n,m=map(int,input().split())
dic={}
for i in range(m):
x,y=map(int,input().split())
if x in dic:
dic[x]+=1
else:
dic[x]=1
if y in dic:
dic[y]+=1
else:
dic[y]=1
for i in range(1,n+1):
print(dic[i]) |
s626176955 | p03720 | u785578220 | 1545592126 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 230 | a , b = map(int,input().split())
k = []
for i in range(b):
t,n = map(int,input().split())
k.append(t)
k.append(n)
import collections
v = collections.Counter(k)
for i in range(a):
print (v.most_common()[i][1]) |
s361289986 | p03720 | u213854484 | 1545414792 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 213 | N,M = map(int, input().split())
A = [list(map(int, input().split())) for i in range(M)]
B = [0]*N
for i in range(M):
a,b = A[i][0],A[i][1]
B[a-1] += 1
B[b-1] += 1
for i in range(M):
print(B[i]) |
s172361262 | p03720 | u213854484 | 1545414712 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 207 | N,M = map(int, input().split())
A = [map(int, input().split()) for i in range(M)]
B = [0]*N
for i in range(M):
a,b = A[i][0],A[i][1]
B[a-1] += 1
B[b-1] += 1
for i in range(M):
print(B[i]) |
s452505640 | p03720 | u213854484 | 1545406948 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 238 | N,M = map(int, input().split())
A = []
for i in range(M):
a,b=input().split()
A.append((int(a), int(b)))
B = [0]*N
for i in range(M):
a,b = A[i][0],A[i][1]
B[a-1] += 1
B[b-1] += 1
for i in range(M):
print(B[i]) |
s325112998 | p03720 | u213854484 | 1545406072 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 168 | N,M = map(int, input().split())
B = [0]*N
for i in range(M):
a,b = map(int, input().split())
B[a-1] += 1
B[b-1] += 1
for i in range(M):
print(B[i]) |
s234396186 | p03720 | u213854484 | 1545405759 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 211 | N,M = map(int, input().split())
A = [list(map(int), input().split()) for _ in range(M)]
B = [0]*N
for i in range(M):
a,b = A[i][0],A[i][1]
B[a-1] += 1
B[b-1] += 1
for i in range(M):
print(B[i]) |
s317902759 | p03720 | u928784113 | 1545060092 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 148 | # -*- coding: utf-8 -*-
N,M = map(int,input().split())
a,b = map(list,input() for i in range(M))
for i in range(N):
print(a.count(i) + b.count(i)) |
s811348698 | p03720 | u523986442 | 1544627210 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 237 | N, M = [int(i) for i in input().split()]
cities = {}
for i in range(M):
cities[i+1] = 0
for i in range(M):
for c in [int(i) for i in input().split()]:
cities[c] += 1
for key, val in sorted(cities.items()):
print(val) |
s308742626 | p03720 | u026155812 | 1544321985 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 257 | N, M = [int(i) for i in input().strip().split()]
A = [[int(i) for i in input().strip().split()] for j in range(M)]
B = {}
for i in range(N):
for j in range(M):
if A[j][0] == i+1:
B[i] = A[j][1]
for i in range(N):
print(len(B[i])) |
s303575462 | p03720 | u047535298 | 1542607903 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 35 | 8 8
1 2
3 4
1 5
2 8
3 7
5 2
4 1
6 8 |
s878045161 | p03720 | u594221936 | 1542565589 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 289 | S = input()
ans = 0
for i in range(2**(len(S)-1)): # 総当たり
tmp = S[0] # 先頭だけ格納
for j in range(len(S)-1): # mask
if i & (1<<j): # iと1をjbitシフトしたものを比較
tmp += "+"
tmp += S[j+1]
ans += eval(tmp)
print(ans)
|
s439364837 | p03720 | u518556834 | 1542520462 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 164 | n.m = map(int,input().split())
ans = [0]*n
for i in range(m):
a,b = map(int,input().split())
ans[a-1] += 1
ans[b-1] += 1
for i in range(n):
print(ans[i])
|
s872174381 | p03720 | u432805419 | 1541560060 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 211 | a = list(map(int,input().split()))
b = [input().split() for i in range(a[1])]
c = []
for i in range(a[1]):
c.append("".join(b[i]))
d = "".join(c)
e = list(d)
for i in range(a[0]):
f = d.count(i)
print(f) |
s653725665 | p03720 | u940102677 | 1538383341 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 162 | n, m = map(int, input().split())
a = []
for i in range(n):
x, y = map(int, input().split())
a.append(x)
a.append(y)
for i in range(m):
print(a.count(i+1)) |
s006920748 | p03720 | u138486156 | 1537896016 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 203 | n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(m)]
b = [0]*n
for i in range(m):
b.index(a[i][0]-1) += 1
b.index(a[i][1]-1) += 1
for i in range(n):
print(b[i])
|
s734241783 | p03720 | u094565093 | 1537393235 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 385 | N,M=map(int,input().split())
S=[list(map(int,input().split())) for i in range(M)]
for i in range(M):
S[i].sort()
for j in range(2):
S[i][j]=str(S[i][j])
S[i]=''.join(S[i])
S=list(set(S))
R=[0]*N
for i in range(N):
n=i+1
for j in range(M):
for k in range(2):
if S[j][k]==st... |
s762272091 | p03720 | u931636178 | 1536699232 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 167 | N,M = map(int,input().split())
ans = [0 for nomean in range(N)]
for i in range(M):
f,t = map(int,input().split())
ans[f] += 1
ans[t] += 1
for a in ans:
print(a) |
s709087914 | p03720 | u668726177 | 1536384640 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 238 | n, m = map(int, input().split())
l = []
l = [0] * n
for _ in range(m):
a, b = map(int, input().split()) # 1-index
l[a] += 1
l[a] -= 1
l[a-1] += 1
l[b-1] += 1
for _ in range(n):
pass
for i in l:
print(i)
|
s658401601 | p03720 | u485716382 | 1534380387 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 201 | def solve():
n, m = map(int, input().split())
lists = []
for _ in range(m):
lists += input().split()
for i in range(i, n + 1):
print(lists.count(str(i)))
solve() |
s364225755 | p03720 | u785220618 | 1530693292 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 332 | # -*- coding: utf-8 -*-
n, m = map(int, input().split())
A = {}
for i in range(m):
data = list(map(int, input().split()))
if data[0] not in A:
A[data[0]] = 1
else:
A[data[0]] += 1
if data[1] not in A:
A[data[1]] = 1
else:
A[data[1]] += 1
for i in range(1, n+1):
... |
s669397971 | p03720 | u140251125 | 1530127922 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 218 | # input
N, M = map(int, input().split())
R = [list(map(int, input().split())) for _ in range(M)]
for i in range(N):
ans = 0
for j in range(1, M + 1):
if i in R[j]:
ans += 1
print(ans)
|
s274241874 | p03720 | u153729035 | 1529122639 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 86 | n,m=map(int,input())
s=open(0).read().split()
for i in range(n):print(s.count(str(i))) |
s930439673 | p03720 | u426501657 | 1527284543 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 597 | import msvcrt
nm=input().split()
NM_list = list(map(int,nm))
A_list=[]
B_list=[]
for m in range(NM_list[1]):
ab=input().split()
AB_list = list(map(int,ab))
A_list.append(AB_list[0])
B_list.append(AB_list[1])
n_list=[]
for n in range(1,NM_list[0]+1):
n_list.append(0)
for i in range(1,len(A_list)+1):
for n_len... |
s165833330 | p03720 | u424967964 | 1525807811 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1037 | #include <iostream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int... |
s065123056 | p03720 | u143492911 | 1523589240 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 281 | n,m=map(int,input().split())
line=[tuple(map(int,input().split()))for i in range(m)]
ans=[]
for i in range(m):
ans.append(line[i][0])
ans.append(line[i][1])
from collections import Counter
data=Counter(ans)
data=sorted(data.items())
for i in range(n):
print(data[i][1]) |
s061648279 | p03720 | u143492911 | 1523588448 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3444 | 281 | n,m=map(int,input().split())
line=[tuple(map(int,input().split()))for i in range(m)]
from collections import Counter
ans=[]
for i in range(m):
ans.append(line[i][0])
ans.append(line[i][1])
data=Counter(ans)
data=sorted(data.items())
for i in range(n):
print(data[i][1]) |
s501515696 | p03720 | u227254381 | 1520375285 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 262 | N, M = map(int, input().split())
connected = {}
for i in range(M):
a, b = map(int, input().split())
connected.setdefault(a, 0)
connected.setdefault(b, 0)
connected[a] += 1
connected[b] += 1
for i in range(1, N + 1):
print(connected[i])
|
s497737031 | p03720 | u636684559 | 1514246549 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 238 | N,M=input().split(' ')
dict={}
for i in range(int(M)):
a,b=input().split(' ')
a=int(a)
b=int(b)
if a not in dict:
dict[a]=0
dict[a]+=1
if b not in dict:
dict[b]=0
dict[b]+=1
for i in range(int(N)):
print(dict[i+1]) |
s851846425 | p03720 | u343437894 | 1499525964 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 211 | n, m = map(int, input().split(" "))
count = [0 for i in range(0,n)]
for i in range(0, m):
a, b = map(int, input().split(" "))
count[a] += 1
count[b] += 1
for i in range(0, n):
print(count[i])
|
s583997832 | p03720 | u343437894 | 1499525914 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 211 | n, m = map(int, input().split(" "))
count = [0 for i in range(0,n)]
for i in range(0, m):
a, b = map(int, input().split(" "))
count[a] L= 1
count[b] += 1
for i in range(0, n):
print(count[i])
|
s007542810 | p03720 | u497040007 | 1496961631 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 126 | n, m = map(int, input().split())
s = ""
[s += input() for i in range(0, m)]
[print(s.count(str(i))) for i in range(1, m + 1)]
|
s026574620 | p03720 | u190525112 | 1496533714 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 276 | x = list(map(int, input().split()))
a=[input() for i in range(x[0])]
count=[]
for i in range(0,x[0]+2):
count=count+[[0,i]]
for i in a:
i=list(map(int, i.split()))
count[i[0]][0]+=1
count[i[1]][0]+=1
for i in range (1,x[0]+1):
print(count[i][0])
|
s461420119 | p03720 | u037164984 | 1495775089 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 259 | # -*- coding: utf-8 -*-
N, M = map(int,input().split())
street = []
for i in range(0,M):
street.append(0)
for i in range(0,M):
a, b = map(int,input().split())
street[a-1] += 1
street[b-1] += 1
for i in range(0,N):
print(street[i]) |
s260704480 | p03720 | u037164984 | 1495774629 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 256 | # -*- coding: utf-8 -*-
N, M = map(int,input().split())
street = []
for i in range(0,M):
street.append(0)
for i in range(0,M):
a, b = map(int,input().split())
street[a-1] += 1
street[b-1] += 1
for i in range(0,N):
print(street[i])
|
s314554728 | p03720 | u037164984 | 1495774544 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 256 | # -*- coding: utf-8 -*-
N, M = map(int,input().split())
street = []
for i in range(0,M):
street.append(0)
for i in range(0,M):
a, b = map(int,input().split())
street[a-1] += 1
street[b-1] += 1
for i in range(0,N):
print(street[i])
|
s161087746 | p03720 | u800610991 | 1494908361 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 326 | # -*- coding: utf-8 -*-
# get three integers separated with half-width break
a, b = map(int, raw_input().split())
# output
l1 = []
for i in xrange(b):
l1.append(0)
for i in xrange(b):
c, d = map(int, raw_input().split())
# l1[c-1] = l1[c-1] + 1
l1[c-1] += 1
l1[d-1] += 1
for i in xrange(a):
print ... |
s304944604 | p03720 | u800610991 | 1494908065 | Python | Python (2.7.6) | py | Runtime Error | 273 | 19524 | 343 | # -*- coding: utf-8 -*-
import numpy as np
# get three integers separated with half-width break
a, b = map(int, raw_input().split())
# output
l1 = []
for i in range(b):
l1.append(0)
for i in range(b):
c, d = map(int, raw_input().split())
# l1[c-1] = l1[c-1] + 1
l1[c-1] += 1
l1[d-1] += 1
for i in ran... |
s282649092 | p03720 | u521271286 | 1494892862 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 164 | n, m = map(int, input().split())
road = [0] * n
for i in m:
a, b = map(int, input().split())
road[a-1] =+ 1
road[b-1] =+ 1
for i in road:
print(i) |
s224638421 | p03720 | u009102496 | 1494882099 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 174 | a,b=map(int,input().split())
alllist=[]
for i in range(b):
tmp=list(map(int,input().split())
alllist.append(tmp)
for chk in range(a):
print(list.alllist(chk+1)) |
s632890215 | p03720 | u825215512 | 1494803921 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38512 | 252 | # ==================================================== #
# -*- coding: utf-8 -*
n, m = map(int, input().split())
arr = [0] * n
for i in range(m):
a, b = map(int, input().split())
arr[a] += 1
arr[b] += 1
for i in range(n):
print(arr[i]) |
s614434440 | p03720 | u590905793 | 1494729145 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 347 | 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[-1]):
tmp = [a] * b
ls.extend(tmp)
ls.sor... |
s892436824 | p03720 | u839857256 | 1494727484 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 130 | n = input()
a = int(n.split()[0])
b = int(n.split()[1])
c = int(n.split()[2])
if a<=c and c<=b:
print("Yes")
else:
print("No")
|
s934464096 | p03720 | u277971517 | 1494726665 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 205 | N, M = map(int, input().split())
Es = [[] for _ in range(N)]
for n in range(N):
a, b = map(int, input().split())
Es[a - 1].append(b - 1)
Es[b - 1].append(a - 1)
for e in Es:
print(len(e))
|
s902811134 | p03720 | u210543511 | 1494725008 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 194 | N, M = [int(i) for i in input().split()]
g = [[int(i) for i in input().split()] for j in range(N)]
f = [item for sublist in g for item in sublist]
for i in range(1,N+1):
print(i, f.count(i)) |
s627816042 | p03720 | u341087021 | 1494724991 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 205 | import sys
n,m = [int(x) for x in sys.stdin.readline().split()]
r = [0] * n
for i in range m:
a, b = [int(x) for x in sys.stdin.readline().split()]
r[a-1] += 1
r[b-1] += 1
for i in range n:
print(r[i]) |
s740453725 | p03720 | u112002050 | 1494724182 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 183 | N, M = map(int, input().split())
road = [0] * N
for _ in range(N):
a, b = [int(i) for i in input().split()]
road[a - 1] += 1
road[b - 1] += 1
for r in road:
print(r)
|
s267018081 | p03720 | u112002050 | 1494724080 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 197 | N, M = map(int, input().split())
road = [0 for _ in range(N)]
for _ in range(N):
a, b = [int(i) for i in input().split()]
road[a - 1] += 1
road[b - 1] += 1
for r in road:
print(r)
|
s546994260 | p03721 | u149249972 | 1601377385 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9040 | 263 | N, K = map(int, input().split())
ab = [[0, 0]] * N
for i in range(N):
_a, _b = map(int, input().split())
ab[i] = [_a, _b]
ab.sort(key=lambda x:x[0])
j = 0
index = 0
while j < K:
j += ab[index][1]
if j < K:
index += 1
print ab[index][0]
|
s279488375 | p03721 | u149249972 | 1601377288 | Python | Python (3.8.2) | py | Runtime Error | 2233 | 707944 | 370 | n, k = map(lambda x: int(x), input().split())
total = [[0, 0]] * k
for i in range(n):
number, copies = map(lambda x: int(x), input().split())
total[i] = [number, copies]
total.sort(key=lambda x: x[0])
count = i = 0
while count < K:
count += total[i][1]
if count < K:
i += 1
print(total[i][0]... |
s757373044 | p03721 | u149249972 | 1601376968 | Python | Python (3.8.2) | py | Runtime Error | 2225 | 710380 | 311 | n, k = map(lambda x: int(x), input().split())
total = [[0, 0]] * k
for i in range(n):
number, copies = map(lambda x: int(x), input().split())
total[i] = [number, copies]
total.sort(key=lambda x: x[0])
add = 0
for pair in total:
add += pair[1]
if add >= k:
print(pair[0])
break |
s361143467 | p03721 | u955691979 | 1600824061 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2348 | 3509012 | 268 | import itertools
n,k = map(int,input().split())
ab = [0]*n
for i in range(n):
ab[i] = input().split()
ans = []
for i in range(n):
tmp = [int(ab[i][0])]*int(ab[i][1])
ans.append(tmp)
ans = list(itertools.chain.from_iterable(ans))
ans.sort()
print(ans[k-1]) |
s320235147 | p03721 | u962330718 | 1600410950 | Python | Python (3.8.2) | py | Runtime Error | 265 | 23536 | 192 | N,K=map(int,input().split())
cnt=0
P=[]
for i in range(N):
a,b=map(int,input().split())
P.append((a,b))
P=sorted(P)
for i in range(N):
cnt+=P[1]
if cnt>=K:
print(P[0]) |
s015662633 | p03721 | u970198631 | 1600374198 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8772 | 116 | AA = list()
for i in range(N):
a,b = map(int,input().split())
for i in [a]*b:
AA.append(i)
print(AA[K-1])
|
s554822077 | p03721 | u705418271 | 1600220369 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9128 | 142 | n,k=map(int,input().split())
s[0]*10**5
for i in range(n):
a,b=map(int,input().split())
s[a-1]+=b
i=0
while k>0:
k-=s[i]
i+=1
print(i) |
s561222034 | p03721 | u276115223 | 1599585433 | Python | Python (3.8.2) | py | Runtime Error | 223 | 19640 | 332 | # ABC 061: C – Big Array
N, K = [int(i) for i in input().split()]
a, b = [], []
for _ in range(N):
tmp = input().split()
a.append(int(tmp[0]))
b.append(int(tmp[1]))
cnt = [0] * 100000
for i in range(N):
cnt[a[i]] += b[i]
for j in range(100000):
if K <= cnt[j]:
print(j)
break
K... |
s499951062 | p03721 | u338597441 | 1598223582 | Python | Python (3.8.2) | py | Runtime Error | 198 | 11608 | 200 | n,k=map(int,input().split())
ans=[0]*(10**5+1)
for i in range(n):
a,b=map(int,input().split())
ans[a]+=b
for i in range(len(ba)):
k-=ans[i]
if k<=0:
print(i)
break |
s682289112 | p03721 | u644907318 | 1598011088 | Python | PyPy3 (7.3.0) | py | Runtime Error | 295 | 100804 | 327 | N,K = map(int,input().split())
A = [list(map(int,input().split())) for _ in range(N)]
B = {}
cnt = 0
i = 0
while K>cnt:
cnt += A[i][1]
B[A[i][0]] = A[i][1]
i += 1
B[A[i-1][0]] = K-(cnt-A[i-1][1])
B = B.items()
B = sorted(B,key=lambda x:x[0])
cnt = 0
i = 0
while K>cnt:
cnt += B[i][1]
i += 1
print(B[i... |
s387764489 | p03721 | u739843002 | 1597604585 | Python | Python (3.8.2) | py | Runtime Error | 324 | 50772 | 348 | N, K = [int(x) for x in input().split(" ")]
placed = 0
elm = []
for i in range(N):
a, b = input().split(" ")
elm.append({
"order": i + 1,
"element": int(a),
"count": int(b)
})
elm.sort(key=lambda e: (e["element"], e["order"]))
for i in range(len(elm)):
placed = e["count"]
if placed >= K:
pr... |
s996296050 | p03721 | u338597441 | 1597082406 | Python | Python (3.8.2) | py | Runtime Error | 217 | 11596 | 234 | n,k=map(int,input().split())
ans=[0]*10**5
for i in range(n):
a,b=map(int,input().split())
ans[a]+=b
v=0
for i in range(k):
v+=ans[i]
if ans[i]==0:
i-=1
if v>=k:
a=i
break
print(a) |
s842512991 | p03721 | u626881915 | 1596677741 | Python | Python (3.8.2) | py | Runtime Error | 272 | 23616 | 182 | n,k=map(int,input().split())
l = []
for i in range(n):
a,b=map(int,input().split())
l.append((a,b))
l = sorted(l)
c = 0
i = 0
while c < k:
c += l[i][1]
i += 1
print(l[i][1]) |
s958928277 | p03721 | u597455618 | 1595826238 | Python | Python (3.8.2) | py | Runtime Error | 127 | 18700 | 331 | import sys
def main():
n, k = map(int, input().split())
ans = [0 for i in range(n+1)]
for x in sys.stdin.readlines():
a, b = map(int, x.split())
ans[a] += b
cnt = 0
for i in range(n+1):
cnt += ans[i]
if cnt >= k:
print(ans[i])
if __name__ == "__main__":... |
s299614006 | p03721 | u597455618 | 1595826214 | Python | Python (3.8.2) | py | Runtime Error | 130 | 18628 | 331 | import sys
def main():
n, k = map(int, input().split())
ans = [0 for i in range(n+1)]
for x in sys.stdin.readlines():
a, b = map(int, x.split())
ans[a] += b
cnt = 0
for i in range(n+1):
cnt += ans[i]
if cnt >= k:
print(ans[i])
if __name__ == "__main__":... |
s809654166 | p03721 | u786020649 | 1595690392 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8964 | 315 | from sys
rl=sys.stdin.readline
def main():
n,k=map(int,rl.strip().split())
ints=[list(map(int,rl.strip().split())) for _ in range(n)]
ints.sort(key=lambda e:e[0])
s=0
for e in ints:
s+=e[1]
if s<=k:
print(e[0])
break
if __name__=='__main__':
main()
|
s718149562 | p03721 | u786020649 | 1595689734 | Python | Python (3.8.2) | py | Runtime Error | 2273 | 2214636 | 198 | from collections import deque
n,k=map(int,input().split())
ints=[list(map(int,input().split())) for _ in range(n)]
d=deque()
for x in ints:
d.extend([x[0]]*x[1])
ans=list(d).sort()
print(ans[k-1]) |
s600965782 | p03721 | u597455618 | 1595477030 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9128 | 279 | import sys
def main():
n, k = map(int, input().split())
cnt = 0
for x in sys.stdin.readlines:
a, b = map(int, x.split())
if cnt + b < k:
cnt += b
else:
print(a)
exit()
if __name__ == "__main__":
main() |
s013374187 | p03721 | u094191970 | 1595211968 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9232 | 331 | from bisect import bisect_left
n,k=map(int,input().split())
l=[]
for i in range(n):
a,b=nii()
l.append([a,b])
l.sort(key=lambda x:x[0])
a_l=[]
b_l=[]
for a,b in l:
a_l.append(a)
b_l.append(b)
b_rui=[0]
for i in range(1,n+1):
b_rui.append(b_rui[i-1]+b_l[i-1])
b_rui=b_rui[1:]
inx=bisect_left(b_rui,k)
prin... |
s008618927 | p03721 | u316603606 | 1594601295 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 35604 | 285 | import numpy as np
N,K = (int(x) for x in input().split())
A = []
B = []
for i in range (N):
a,b = (int(x) for x in input().split())
A.append (a)
B.append (b)
for i in range (N):
x = np.argmin(A)
if B[x] >= K:
print (A[x])
break
else:
K -= B[x]
A.pop (A[x]) |
s573738831 | p03721 | u514118270 | 1594502430 | Python | PyPy3 (7.3.0) | py | Runtime Error | 122 | 77384 | 575 | import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(... |
s089321539 | p03721 | u033403579 | 1594493752 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 10608 | 216 | n, k = map(int, input().split())
INF = 10 ** 5 + 1
arr = [INF] * 4
for i in range(n):
a, b = map(int, input().split())
new = [a] * min(b, 4)
arr += new
arr.sort()
arr = arr[:k]
print(arr[k-1])
|
s326308385 | p03721 | u760794812 | 1593601934 | Python | Python (3.8.2) | py | Runtime Error | 246 | 16356 | 249 | N,M = map(int,input().split())
dic = {}
for _ in range(N):
a, b = map(int,input().split())
if a in dic:
dic[a] += b
else:
dic[a] = b
List = sorted(dic)
ans = 0
i = 0
while M >= 0:
M -= dic[List[i]]
ans = List[i]
i += 1
print(ans) |
s268265088 | p03721 | u760794812 | 1593601535 | Python | Python (3.8.2) | py | Runtime Error | 230 | 16096 | 243 | N,M = map(int,input().split())
dic = {}
for _ in range(N):
a, b = map(int,input().split())
if a in dic:
dic[a] += b
else:
dic[a] = b
List = sorted(dic)[::-1]
ans = 0
i = 1
while M > 0:
M -= dic[i]
ans = i
i += 1
print(ans)
|
s990031117 | p03721 | u485319545 | 1592355287 | Python | Python (3.4.3) | py | Runtime Error | 356 | 15264 | 309 | n,k=map(int,input().split())
a=[]
b=[]
d={}
for _ in range(n):
a_i,b_i=map(int,input().split())
d[a_i]=b_i
d=sorted(d.items(),key=lambda x: x[0])
prev=0
for key,value in d:
a.append(key)
b.append(prev+value)
prev+=value
for j in range(n):
if k<=b[j]:
break
print(a[j])
|
s502455718 | p03721 | u759412327 | 1592241879 | Python | Python (3.4.3) | py | Runtime Error | 2085 | 985996 | 117 | N,K = map(int,input().split())
ans = ""
for n in range(N):
a,b = input().split()
ans+= a*int(b)
print(ans[K-1]) |
s107697568 | p03721 | u730769327 | 1591598096 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 211 | n,k=map(int,input().split())
a,b=map(int,input().split())
d=[]*(10**5+1)
for i in range(n-1):
a,b=map(int,input().split())
d[a]+=b
for i in range(10**5+1):
if d[i]>k:
print(i)
break
else:k-=d[i]
|
s395720691 | p03721 | u730769327 | 1591597159 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 311624 | 193 | n,k=map(int,input().split())
a,b=map(int,input().split())
s=[]
s+=[a]*b
for i in range(n-1):
a,b=map(int,input().split())
if a>s[-1]:
continue
s+=[a]*b
p=sorted(s)[:k]
print(p[k-1]) |
s491657333 | p03721 | u730769327 | 1591596785 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 116940 | 189 | n,k=map(int,input().split())
a,b=map(int,input().split())
s=[]
s+=[a]*b
for i in range(n-1):
a,b=map(int,input().split())
if a>max(s) and len(s)>k:
continue
s+=[a]*b
print(p[k-1]) |
s527385390 | p03721 | u730769327 | 1591596339 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38256 | 161 | n,k=map(int,input().split())
s=[]
for i in range(n):
a,b=map(int,input().split())
if a>max(s) and len(s)>k:
continue
s+=[a]*b
p=sorted(s)
print(p[k-1]) |
s776892680 | p03721 | u587589241 | 1590356053 | Python | Python (3.4.3) | py | Runtime Error | 2023 | 985868 | 115 | n,k=map(int,input().split())
A=""
for i in range(n):
a,b=map(int,input().split())
A+=str(a)*b
print(A[k-1]) |
s483089643 | p03721 | u344813796 | 1589898831 | Python | Python (3.4.3) | py | Runtime Error | 342 | 27352 | 177 | import sys
n,k=map(int, input().split()) #a1 a2 a3
com = [list(map(int, input().split())) for _ in range(n)]
i=0
while k>0:
k-=com[i][1]
i+=1
print(com[~i][0]) #~i -i-1
|
s582355956 | p03721 | u344813796 | 1589898757 | Python | Python (3.4.3) | py | Runtime Error | 339 | 27352 | 176 | import sys
n,k=map(int, input().split()) #a1 a2 a3
com = [list(map(int, input().split())) for _ in range(n)]
i=0
while k>0:
k-=com[i][0]
i+=1
print(com[~i][0]) #~i -i-1 |
s504689850 | p03721 | u519923151 | 1589853257 | Python | Python (3.4.3) | py | Runtime Error | 453 | 29844 | 230 | n,k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
abb = ab.sort()
temp =0
for i in range(n):
if temp < k:
temp += abb[i][1]
else:
print(abb[i-1][0])
exit() |
s983730292 | p03721 | u760636024 | 1589756750 | Python | PyPy3 (2.4.0) | py | Runtime Error | 589 | 58072 | 265 | N,K = map(int, input().split())
A = []
ruiseki = [0]
for i in range(N):
a,b = map(int, input().split())
A.append(a)
ruiseki.append(ruiseki[i]+b)
K = ruiseki[-1]-K+1
for i in range(1,N+1):
if K >= ruiseki[i]:
n = i
break
print(A[n+1]) |
s216738229 | p03721 | u135847648 | 1589686291 | Python | Python (3.4.3) | py | Runtime Error | 450 | 16696 | 231 | import numpy as np
n,k = map(int,input().split())
c = [0] * (10**5+1)
for _ in range(n):
a,b = map(int,input().split())
c[a] += b
A = np.array(c,dtype=np.int32)
A = A.cumsum()
answer = (A >= k).nonzero()[0].min()
print(answer) |
s066034057 | p03721 | u496687522 | 1589553311 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 208 | N, K = map(int, input().split())
a_b = [list(map(input().split())) for i in range(N)]
a_b.sort()
index = 0
for i in range(N):
index += a_b[i][1]
if index >= K:
print(a_b[i][0])
exit() |
s950745546 | p03721 | u044459372 | 1589408875 | Python | Python (3.4.3) | py | Runtime Error | 2309 | 988164 | 376 | def main():
n, k = map(int, input().split())
a, b = [0 for i in range(n)], [0 for i in range(n)]
for i in range(n):
x, y = input().split()
a[i], b[i] = x, int(y)
ans = solve(n, k, a, b)
print(ans)
def solve(n, k, a, b):
s = ''
for i in range(n):
s += a[i] * b[i]
... |
s838589525 | p03721 | u207799478 | 1588881572 | Python | PyPy3 (2.4.0) | py | Runtime Error | 832 | 62040 | 951 | import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
from operator import itemgetter
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60
def readints():
return list(map(int, input().split()))
def nCr(n, r):
return math.factorial(n)//(m... |
s138765509 | p03721 | u207799478 | 1588881431 | Python | PyPy3 (2.4.0) | py | Runtime Error | 844 | 62040 | 952 | import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
from operator import itemgetter
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60
def readints():
return list(map(int, input().split()))
def nCr(n, r):
return math.factorial(n)//(m... |
s945192294 | p03721 | u802234211 | 1588818598 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 11944 | 585 | from itertools import chain
N,K = map(int,input().split())
numarray = list()
num_bool = [0]*(10**5)
numarray_ind = list()
for i in range(N):
a,b = map(int,input().split())
num_bool[a-1]+=1
if(num_bool[a-1]>=2):
numarray[numarray_ind.index(a)][1]+=b
# print(numarray)
else:
... |
s419590279 | p03721 | u802234211 | 1588818382 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 9244 | 602 | from itertools import chain
N,K = map(int,input().split())
numarray = list()
num_bool = [0]*(10**5)
for i in range(N):
a,b = map(int,input().split())
num_bool[a-1]+=1
if(num_bool[a-1]>=2):
pos = divmod( list(chain(*numarray)).index(a), len(numarray[0])
)
numarray[pos[0]][1]+=b
... |
s767848925 | p03721 | u257442624 | 1588605943 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 221 | N, K = map(int, input().split())
num = [0]*(10**5+1)
for i in range(N):
a, b= map(int, input().split())
num[a] += b
for i in range(1, 10**5+1):
if K <= num[i]:
print(i)
exit()
K -= num[i]: |
s932565255 | p03721 | u257442624 | 1588562896 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3888 | 198 | N, K = map(int, input().split())
c = []
for _ in range(N):
a, b= map(int, input().split())
for i in range(b):
c.append(a)
if d <= K:
break
print(sorted(c)[K-1]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.