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
s934091322
p03578
u418826171
1599793091
Python
Python (3.8.2)
py
Runtime Error
113
39328
320
n = int(input()) D = list(map(int,input().split())) m = int(input()) T = list(map(int,input().split())) if m > n: print('NO') exit() numd = [0]*200005 numt = [0]*200005 for d in D: numd[d] += 1 for t in T: numt[t] += 1 for t in T: if numt[t] > numd[t]: print('NO') exit() print('YES')
s267910915
p03578
u418826171
1599793040
Python
Python (3.8.2)
py
Runtime Error
26
8812
301
= list(map(int,input().split())) m = int(input()) T = list(map(int,input().split())) if m > n: print('NO') exit() numd = [0]*200005 numt = [0]*200005 for d in D: numd[d] += 1 for t in T: numt[t] += 1 for t in T: if numt[t] > numd[t]: print('NO') exit() print('YES')
s138998894
p03578
u609814378
1598022095
Python
Python (3.8.2)
py
Runtime Error
421
71276
857
from collections import Counter import sys N = int(input()) D = list(map(int, input().split())) D = sorted(D) D_counter = Counter(D) M = int(input()) T = list(map(int, input().split())) T = sorted(T) T_counter = Counter(T) #一つずつずらしていく、Tのkeyとvalueを取り出す D_keylist = (list(D_counter.items())) #一つずつずらしていく、Tのkeyとvalueを...
s055733277
p03578
u609814378
1598022018
Python
Python (3.8.2)
py
Runtime Error
434
71132
812
from collections import Counter import sys N = int(input()) D = list(map(int, input().split())) D = sorted(D) D_counter = Counter(D) M = int(input()) T = list(map(int, input().split())) T = sorted(T) T_counter = Counter(T) #一つずつずらしていく、Tのkeyとvalueを取り出す D_keylist = (list(D_counter.items())) #一つずつずらしていく、Tのkeyとvalueを...
s359898421
p03578
u575956662
1597395002
Python
Python (3.8.2)
py
Runtime Error
123
39072
399
import sys n = int(input()) dn = list(map(int, input().split())) m = int(input()) tn = list(map(int, input().split())) d_num = [0 for i in range(200001)] t_num = [0 for i in range(200001)] for i in range(len(dn)): d_num[dn[i]] += 1 for i in range(len(tn)): t_num[tn[i]] += 1 for i in range(len(t_num)): ...
s507956092
p03578
u575956662
1597394902
Python
Python (3.8.2)
py
Runtime Error
121
39572
399
import sys n = int(input()) dn = list(map(int, input().split())) m = int(input()) tn = list(map(int, input().split())) d_num = [0 for i in range(200001)] t_num = [0 for i in range(200001)] for i in range(len(dn)): d_num[dn[i]] += 1 for i in range(len(tn)): t_num[tn[i]] += 1 for i in range(len(t_num)): ...
s328485819
p03578
u951480280
1597068694
Python
Python (3.8.2)
py
Runtime Error
453
56732
513
n=int(input()) d=sorted(map(int,input().split())) m=int(input()) t=sorted(map(int,input().split())) d_dic = dict() t_dic = dict() for i in range(n): d1 = d[i] if d1 not in d_dic.keys(): d_dic[d1] = 1 else: d_dic[d1] += 1 for i in range(m): t1 = t[i] if t1 not in t_dic.keys(): ...
s129007788
p03578
u464205401
1596254682
Python
PyPy3 (7.3.0)
py
Runtime Error
2209
123796
301
import bisect n = int(input()) d = sorted(list(map(int,input().split()))) m = int(input()) t = list(map(int,input().split())) flg = True for i in range(m): index = bisect.bisect_left(d,t[i]) if t[i] == d[index]: del d[index] else: flg = False break print('YES' if flg else 'NO')
s182856417
p03578
u464205401
1596254417
Python
Python (3.8.2)
py
Runtime Error
2074
41172
319
import bisect n = int(input()) d = sorted(list(map(int,input().split()))) m = int(input()) t = list(map(int,input().split())) d.append(d[-1]+1) flg = True for i in range(m): index = bisect.bisect_left(d,t[i]) if t[i] == d[index]: del d[index] else: flg = False break print('YES' if flg else 'NO')
s840213813
p03578
u464205401
1596253062
Python
Python (3.8.2)
py
Runtime Error
1998
41364
299
import bisect n = int(input()) d = sorted(list(map(int,input().split()))) m = int(input()) t = list(map(int,input().split())) flg = True for i in range(m): index = bisect.bisect_left(d,t[i]) if t[i] == d[index]: del d[index] else: flg = False break print('YES' if flg else 'NO')
s140592286
p03578
u640922335
1595953248
Python
Python (3.8.2)
py
Runtime Error
70
31340
228
N=int(input()) D=list(map(int,input().split())) D.sorted() M=int(input()) T=list(map(int,input().split())) T.sorted() for num in T: if num in D: D.remove(num) else: print('NO') exit() print('YES')
s429299371
p03578
u357751375
1595713352
Python
Python (3.8.2)
py
Runtime Error
211
39580
233
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) d.sort() t.sort() j = 0 for i in range(n): if d[i] == t[j]: j += 1 if j == m: print('YES') else: print('NO')
s606943008
p03578
u143051858
1593277062
Python
Python (3.8.2)
py
Runtime Error
77
31520
424
# 計算量O(N2M) N = int(input()) d = list(map(int,input().split())) d_cnt = [0]*max(d) for v in d: d_cnt[v-1] += 1 M = int(input()) t = list(map(int,input().split())) t_cnt = [0]*max(t) for v in t: t_cnt[v-1] += 1 if N < M: print('NO') exit() for i in range(min(len(d_cnt),len(t_cnt))): if t_cnt[...
s559298150
p03578
u143051858
1593276717
Python
Python (3.8.2)
py
Runtime Error
70
31648
409
# 計算量O(N2M) N = int(input()) d = list(map(int,input().split())) d_cnt = [0]*max(d) for v in d: d_cnt[v-1] += 1 M = int(input()) t = list(map(int,input().split())) t_cnt = [0]*max(t) for v in t: t_cnt[v-1] += 1 if N < M: print('NO') exit() for i in range(len(t_cnt)): if t_cnt[i] != 0: ...
s724565921
p03578
u143051858
1593276246
Python
Python (3.8.2)
py
Runtime Error
73
31500
393
# 計算量O(N2M) N = int(input()) d = list(map(int,input().split())) d_cnt = [0]*max(d) for v in d: d_cnt[v-1] += 1 M = int(input()) t = list(map(int,input().split())) t_cnt = [0]*max(t) for v in t: t_cnt[v-1] += 1 if N < M: print('NO') exit() for dn,tn in zip(d_cnt,t_cnt): if tn != 0: if...
s162070257
p03578
u212502386
1592618176
Python
PyPy3 (7.3.0)
py
Runtime Error
163
117780
265
n= int(input()) D=list(map(int,input().split())) m=int(input()) T=list(map(int,input().split())) cnt=[0]*1000000010 for i in range(n): cnt[D[i]]+=1 ans="YES" for i in range(m): cnt[T[i]]-=1 if cnt[T[i]]<0: ans="NO" break print(ans)
s038702562
p03578
u453642820
1591789920
Python
Python (3.4.3)
py
Runtime Error
17
2940
281
mport collections n = int(input()) ln = list(map(int, input().split())) m = int(input()) lm = list(map(int, input().split())) c1 = collections.Counter(lm) c2 = collections.Counter(ln) for i in c1.keys(): if c2[i] < c1[i]: print("NO") exit() print("YES")
s377455298
p03578
u830054172
1591583874
Python
Python (3.4.3)
py
Runtime Error
135
35420
333
N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) d = [0 for _ in range(200005)] t = [0 for _ in range(200005)] ans = "YES" for i in range(N): d[D[i]] += 1 for i in range(M): t[T[i]] += 1 for i in range(len(d)): if t[i] > d[i]: ans = "NO"...
s412192036
p03578
u830054172
1591583679
Python
Python (3.4.3)
py
Runtime Error
118
35420
314
N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) d = [0 for _ in range(200005)] ans = "YES" for i in range(N): d[D[i]] += 1 for i in range(M): # print(d[T[i]-1]) d[T[i]] -= 1 if d[T[i]] < 0: ans = "NO" break print(ans)
s240784627
p03578
u830054172
1591583581
Python
Python (3.4.3)
py
Runtime Error
197
39004
336
N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) d = [0 for _ in range(2000005)] ans = "YES" for i in range(N): d[D[i]] += 1 # print(d) for i in range(M): # print(d[T[i]-1]) d[T[i]] -= 1 if d[T[i]] < 0: ans = "NO" break # prin...
s342947950
p03578
u830054172
1591583405
Python
Python (3.4.3)
py
Runtime Error
198
39248
375
from collections import Counter N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) d = [0 for _ in range(2000005)] ans = "YES" for i in range(N): d[D[i]-1] += 1 # print(d) for i in range(M): # print(d[T[i]-1]) d[T[i]-1] -= 1 if d[T[i]-1] < 0: ...
s033807000
p03578
u227085629
1591469743
Python
Python (3.4.3)
py
Runtime Error
261
56788
370
n = int(input()) dl = list(map(int,input().split())) m = int(input()) tl = list(map(int,input().split())) d_dic = dict() t_dic = dict() for d in dl: if d in d_dic: d_dic[d] += 1 else: d_dic[d] = 1 for t in tl: if t in t_dic: t_dic[t] += 1 else: t_dic[t] = 1 for v in t_dic.keys(): if t_dic[v] >...
s288665526
p03578
u474925961
1591229634
Python
Python (3.4.3)
py
Runtime Error
129
35024
696
import heapq n=int(input()) d=list(map(int,input().split())) m=int(input()) t=list(map(int,input().split())) heapq.heapify(d) heapq.heapify(t) cnt=0 if n>1 and m>1: for i in range(m): a=heapq.heappop(t) if len(b)>0: b=heapq.heappop(d) #print(a,b,cnt) while b<a and len(...
s837219660
p03578
u474925961
1591227579
Python
Python (3.4.3)
py
Runtime Error
522
34040
658
import heapq n=int(input()) d=list(map(int,input().split())) m=int(input()) t=list(map(int,input().split())) heapq.heapify(d) heapq.heapify(t) cnt=0 if n>1 and m>1: for i in range(m): a=heapq.heappop(t) b=heapq.heappop(d) #print(a,b,cnt) while b<a: b=heapq.heappop(d) ...
s660049052
p03578
u474925961
1591227437
Python
Python (3.4.3)
py
Runtime Error
520
35024
583
import heapq n=int(input()) d=list(map(int,input().split())) m=int(input()) t=list(map(int,input().split())) heapq.heapify(d) heapq.heapify(t) cnt=0 if n>1 and m>1: for i in range(m): a=heapq.heappop(t) b=heapq.heappop(d) #print(a,b,cnt) while b<a: b=heapq.heappop(d) ...
s081272178
p03578
u474925961
1591227169
Python
Python (3.4.3)
py
Runtime Error
553
34040
379
import heapq n=int(input()) d=list(map(int,input().split())) m=int(input()) t=list(map(int,input().split())) heapq.heapify(d) heapq.heapify(t) cnt=0 for i in range(m): a=heapq.heappop(t) b=heapq.heappop(d) #print(a,b,cnt) while b<a: b=heapq.heappop(d) if b==a: cnt+=1 ...
s696119728
p03578
u339199690
1591045372
Python
Python (3.4.3)
py
Runtime Error
113
33784
304
import sys N = int(input()) D = list(map(int, sys.stdin.readline().rsplit())) M = int(input()) T = list(map(int, sys.stdin.readline().rsplit())) q = [0] * (10 ** 9 + 1) for d in D: q[d] += 1 for t in T: if q[t] > 0: q[t] -= 1 else: print("NO") exit() print("YES")
s035832496
p03578
u339199690
1591045283
Python
Python (3.4.3)
py
Runtime Error
116
35404
303
import sys N = int(input()) D = list(map(int, sys.stdin.readline().rsplit())) M = int(input()) T = list(map(int, sys.stdin.readline().rsplit())) q = [0] * (max(D) + 1) for d in D: q[d] += 1 for t in T: if q[t] > 0: q[t] -= 1 else: print("NO") exit() print("YES")
s139297616
p03578
u601575292
1590201075
Python
Python (3.4.3)
py
Runtime Error
267
56672
605
n = int(input()) d = list(map(int, input().split())) m = int(input()) t = list(map(int, input().split())) # n 問題案数 # m 必要問題数 # d 難易度 # t 難易度 freq_of_val_in_d = dict() freq_of_val_in_t = dict() for v in d: if v in freq_of_val_in_d: freq_of_val_in_d[v] += 1 continue freq_of_val_in_d[v] = 1 for...
s963400996
p03578
u134019875
1589966929
Python
Python (3.4.3)
py
Runtime Error
310
56788
422
n = int(input()) d = list(map(int, input().split())) m = int(input()) t = list(map(int, input().split())) D = {} for i in range(n): if d[i] not in D: D[d[i]] = 1 else: D[d[i]] += 1 T = {} for j in range(m): if t[j] not in T: T[t[j]] = 1 else: T[t[j]] += 1 for k in T: ...
s720648866
p03578
u860002137
1589953573
Python
Python (3.4.3)
py
Runtime Error
239
41700
280
from collections import defaultdict N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) memo = defaultdict(int) for d in D: memo[d] += 1 for t in T: memo[t] -= 1 memo.sort() print("YES" if memo[0] >= 0 else "NO")
s741051358
p03578
u922449550
1589688400
Python
Python (3.4.3)
py
Runtime Error
191
46560
274
from collections import defaultdict N = int(input()) D = list(map(int, input().split())) kind = defaultdict(int) for d in D: kind[d] += 1 M = int(input()) T = list(map(int, input().split())) for t in T: d[t] -= 1 if d[t] < 0: print('NO') quit() print('YES')
s851516768
p03578
u572142121
1589383199
Python
Python (3.4.3)
py
Runtime Error
332
56788
361
N=int(input()) D=list(map(int, input().split())) M=int(input()) T=list(map(int, input().split())) if N<M: print('NO') exit() A={} B={} for i in D: if i not in A: A[i]=0 A[i]+=1 for i in T: if i not in B: B[i]=0 B[i]+=1 for i in B.keys(): if not A[i]: print('NO') exit() if A[i]<B[i]...
s597471865
p03578
u488178971
1588993749
Python
Python (3.4.3)
py
Runtime Error
128
35420
383
N = int(input()) D = [int(i) for i in input().split()] M = int(input()) T = [int(i) for i in input().split()] if N < D: print('NO') exit() from collections import Counter d_count = Counter(D) t_count = Counter(T) for k,v in t_count.items(): if k not in d_count: print('NO') exit() if ...
s836885774
p03578
u488178971
1588993720
Python
Python (3.4.3)
py
Runtime Error
129
35556
383
N = int(input()) D = [int(i) for i in input().split()] M = int(input()) T = [int(i) for i in input().split()] if N < T: print('NO') exit() from collections import Counter d_count = Counter(D) t_count = Counter(T) for k,v in t_count.items(): if k not in d_count: print('NO') exit() if ...
s537278260
p03578
u263830634
1588904021
Python
Python (3.4.3)
py
Runtime Error
24
7284
296
from collections import defaultdict N = int(input()) D = list(map(int, input())) M = int(input()) T = list(map(int, input().split())) dic = defaultdict(int) for d in D: dic[d] += 1 for t in T: if dic[t]: dic[t] -= 1 else: print ('No') exit() print ('Yes')
s229161891
p03578
u411203878
1588592711
Python
PyPy3 (2.4.0)
py
Runtime Error
370
127572
369
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) max_diff = max(max(d),max(t)) diff = [0]*(max_diff+1) for i in d: diff[i] += 1 flag = True print(1111111) for i in t: if diff[i] > 0: diff[i] -= 1 else: flag = False break...
s082353040
p03578
u411203878
1588592486
Python
PyPy3 (2.4.0)
py
Runtime Error
381
127696
354
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) max_diff = max(max(d),max(t)) diff = [0]*(max_diff+10) for i in d: diff[i] += 1 flag = True for i in t: if diff[i] > 0: diff[i] -= 1 else: flag = False break if flag: ...
s846424595
p03578
u411203878
1588592289
Python
PyPy3 (2.4.0)
py
Runtime Error
390
127572
362
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) max_diff = max(max(d),max(t)) diff = [0]*(max_diff+1) for i in d: diff[i] += 1 flag = True for i in t: if diff[i] > 0: diff[i] -= 1 else: flag = False break if flag: p...
s053465360
p03578
u411203878
1588592230
Python
PyPy3 (2.4.0)
py
Runtime Error
388
127572
341
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) max_diff = max(d) diff = [0]*(max_diff+1) for i in d: diff[i] += 1 flag = True for i in t: if diff[i] > 0: diff[i] -= 1 else: flag = False break if flag: print('YES') ...
s063822824
p03578
u212328220
1588439024
Python
Python (3.4.3)
py
Runtime Error
2105
35556
378
N = int(input()) D_list = list(map(int, input().split())) M = int(input()) T_list = list(map(int, input().split())) dic_T = {} for i in T_list: dic_T[i] = T_list.count(i) dic_D = {} for i in D_list: dic_D[i] = D_list.count(i) ans = 'YES' for k in dic_T: if dic_T[k] > dic_D[k]: ans = 'NO' ...
s128647452
p03578
u212328220
1588438971
Python
Python (3.4.3)
py
Runtime Error
2105
35420
379
N = int(input()) D_list = list(map(int,input().split())) M = int(input()) T_list = list(map(int,input().split())) dic_T = {} for i in T_list: dic_T[i] = T_list.count(i) dic_D = {} for i in D_list: dic_D[i] = D_list.count(i) ans = 'YES' for k in dic_T: if dic_T[k] > dic_D[k]: ans = 'NO' pr...
s896535804
p03578
u409306788
1588413770
Python
Python (3.4.3)
py
Runtime Error
259
41816
358
# B - Problem Set n = int(input()) d = list(map(int, input().split())) m = int(input()) t = list(map(int, input().split())) dic = dict() for di in d: if di in dic.keys(): dic[di] += 1 else: dic[di] = 1 for ti in t: if not ti in dic.keys(): print('NO') sys.exit() elif dic[ti] < 1: print('NO') sys.exit...
s187769798
p03578
u970523279
1587920373
Python
PyPy3 (2.4.0)
py
Runtime Error
389
127568
379
import sys n = int(input()) D = list(map(int, input().split())) m = int(input()) T = list(map(int, input().split())) max_diff = max(D) difficulty = [0] * (max_diff + 1) for d in D: difficulty[d] += 1 for t in T: if t > max_diff: print('NO') sys.exit() difficulty[t] -= 1 if difficulty[t...
s465073319
p03578
u818349438
1586891997
Python
PyPy3 (2.4.0)
py
Runtime Error
416
127572
351
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) if n < m: print('NO') exit(0) dcnt = {} for x in d:dcnt[x] = 0 ok = True for x in d:dcnt[x]+=1 for i in range(m): if t[i] not in dcnt:ok = False if dcnt[t[i]] == 0:ok = False dcnt[t[i]] -= 1 if ok...
s253287351
p03578
u818349438
1586891945
Python
Python (3.4.3)
py
Runtime Error
253
41816
316
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) if n < m: print('NO') exit(0) dcnt = {} for x in d:dcnt[x] = 0 ok = True for x in d:dcnt[x]+=1 for i in range(m): if dcnt[t[i]] == 0:ok = False dcnt[t[i]] -= 1 if ok:print('YES') else:print('NO')
s070819280
p03578
u959225525
1586834171
Python
Python (3.4.3)
py
Runtime Error
152
46560
268
import collections n=int(input()) d=list(map(int,input().split())) li=collections.Counter(d) m=int(input()) t=list(map(int,input().split())) co=[0]*200001 for i in t: if (li[i]-co[i])>0: co[i]+=1 else: print("NO") exit() print("YES")
s448090217
p03578
u735008991
1586805688
Python
PyPy3 (2.4.0)
py
Runtime Error
411
123348
429
N = int(input()) D = sorted(list(map(int, input().split()))) M = int(input()) T = sorted(list(map(int, input().split()))) C = [0] * 3*10**5 for d in D: if d in C: C[d] += 1 else: C[d] = 1 E = [0] * 3*10**5 for t in T: if t in E: E[t] += 1 else: E[t] = 1 for key, val in en...
s268680036
p03578
u414458988
1586046112
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38512
205
n=int(input()) d=Counter(map(int,input().split())) m=int(input()) t=Counter(map(int,input().split())) from collections import Counter for i in t: if d[i] < t[i]: print('NO') exit() print('YES')
s522988106
p03578
u499381410
1584903295
Python
PyPy3 (2.4.0)
py
Runtime Error
173
38256
2510
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecD = vector<ld>; using VecS = vector<string>; using Graph = vector<V...
s457853842
p03578
u499381410
1584903190
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38384
2503
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; using P = pair<ll, ll>; using Pld = pair<ld, ld>; using Vec = vector<ll>; using VecP = vector<P>; using VecB = vector<bool>; using VecC = vector<char>; using VecD = vector<ld>; using VecS = vector<string>; using Graph = vector<V...
s577595667
p03578
u166340293
1584074655
Python
Python (3.4.3)
py
Runtime Error
2105
34768
312
N=int(input()) D=list(map(int,input().split())) M=int(input()) T=list(map(int,input().split())) flag=0 for i in range(M): flag=0 for j in range(N): if D[j]==T[i] and flag==0: D.remove(D[j]) flag=1 if flag!=0: break if flag==0: flag=2 print("No") if flag==1: print("Yes")
s814770747
p03578
u857330600
1583130235
Python
Python (3.4.3)
py
Runtime Error
18
2940
226
n=int(input()) l=list(map(int,input().split())) m=int(input()) pl=list(map(int,input().split())) for i in range(m): if not pl[i] in set(l): print('NO') break else: l.remove(pl[i]) if i==m-1: print('YES')v
s225624143
p03578
u857330600
1583130163
Python
Python (3.4.3)
py
Runtime Error
17
2940
225
n=int(input()) l=list(map(int,input().split())) m=int(input()) pl=list(map(int,input().split())) for i in range(m): if not pl[i] in set(l): print('NO') break elif: l.remove(pl[i]) if i==m-1: print('YES')
s259414404
p03578
u371409687
1582318918
Python
Python (3.4.3)
py
Runtime Error
236
41316
292
n=int(input()) dp=list(map(int,input().split())) m=int(input()) tp=list(map(int,input().split())) d=dict() ans="YES" for di in dp: if di in d: d[di]+=1 else: d[di]=1 for ti in tp: if d[ti]==0: ans="NO" break else: d[ti]-=1 print(ans)
s062472414
p03578
u371409687
1582318859
Python
Python (3.4.3)
py
Runtime Error
245
41316
292
n=int(input()) dp=list(map(int,input().split())) m=int(input()) tp=list(map(int,input().split())) d=dict() ans="YES" for di in dp: if di in d: d[di]+=1 else: d[di]=1 for ti in tp: if d[ti]==0: ans="No" break else: d[ti]-=1 print(ans)
s626669208
p03578
u747703115
1582309040
Python
Python (3.4.3)
py
Runtime Error
19
2940
374
n = int(input()) D = list(map(int, input().split())) m = int(input()) T = list(map(int, input().split())) D.sort() T.sort() if n=<m: if D==T: print('YES') exit() else: print('NO') exit() r = 'YES' for i in range(m): if T[i] in D: idx = D.index(T[i]) D = D[idx...
s883342629
p03578
u138781768
1580784188
Python
PyPy3 (2.4.0)
py
Runtime Error
350
127700
358
n = int(input()) dlis = list(map(int, input().split())) m = int(input()) tlis = list(map(int, input().split())) def list_difference(list1, list2): result = list1.copy() for value in list2: if value in result: result.remove(value) return result lis = list_difference(tlis, dlis) if lis: ...
s413883316
p03578
u127499732
1580740588
Python
Python (3.4.3)
py
Runtime Error
263
57056
272
import collections n=int(input()) d=list(map(int,input().split())) m=int(input()) t=list(map(int,input().split())) dd,tt=collections.Counter(d),collections.Counter(t) for k,v in tt.items(): h=dd.get(k)>=v if h==False or h==None: print("NO") exit() print("YES")
s902505126
p03578
u127499732
1580740398
Python
Python (3.4.3)
py
Runtime Error
267
57056
261
import collections n=int(input()) d=list(map(int,input().split())) m=int(input()) t=list(map(int,input().split())) dd,tt=collections.Counter(d),collections.Counter(t) for k,v in tt.items(): h=dd.get(k)>=v if h==False: print("NO") exit() print("YES")
s172774961
p03578
u476124554
1579613788
Python
Python (3.4.3)
py
Runtime Error
287
41316
376
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) count = {} for i in range(n): if d[i] in count.keys(): count[d[i]] += 1 else: count[d[i]] = 1 for i in range(m): if count[t[i]] == 0: print("NO") break else: ...
s815529336
p03578
u540761833
1579039822
Python
Python (3.4.3)
py
Runtime Error
186
57056
331
from collections import Counter N = int(input()) D = list(map(int,input().split())) M = int(input()) T = list(map(int,input().split())) Tcount = Counter(T) flag = 'YES' Dcount = Counter(D) for n,c in Tcount.items(): if n not in D: flag = 'NO' break if c > D[n]: flag = 'NO' break ...
s209989373
p03578
u540761833
1579039786
Python
Python (3.4.3)
py
Runtime Error
193
57056
279
from collections import Counter N = int(input()) D = list(map(int,input().split())) M = int(input()) T = list(map(int,input().split())) Tcount = Counter(T) flag = 'YES' Dcount = Counter(D) for n,c in Tcount.items(): if c > D[n]: flag = 'NO' break print(flag)
s661127368
p03578
u768896740
1576965292
Python
Python (3.4.3)
py
Runtime Error
371
57056
543
import collections import bisect n = int(input()) a = list(map(int, input().split())) a.sort() m = int(input()) b = list(map(int, input().split())) if n < m: print('NO') exit() c = collections.Counter(a) d = collections.Counter(b) e = [] for i in c.keys(): e.append(i) f = [] for i in c.values(): f...
s288543281
p03578
u768896740
1576964669
Python
Python (3.4.3)
py
Runtime Error
285
57056
532
import collections import bisect n = int(input()) a = list(map(int, input().split())) m = int(input()) b = list(map(int, input().split())) if n < m: print('NO') exit() c = collections.Counter(a) d = collections.Counter(b) e = [] for i in c.keys(): e.append(i) f = [] for i in c.values(): f.append(i...
s860882783
p03578
u768896740
1576964627
Python
PyPy3 (2.4.0)
py
Runtime Error
432
127700
532
import collections import bisect n = int(input()) a = list(map(int, input().split())) m = int(input()) b = list(map(int, input().split())) if n < m: print('NO') exit() c = collections.Counter(a) d = collections.Counter(b) e = [] for i in c.keys(): e.append(i) f = [] for i in c.values(): f.append(i...
s901626328
p03578
u768896740
1576957329
Python
Python (3.4.3)
py
Runtime Error
162
41700
423
import collections import bisect n = int(input()) a = list(map(int, input().split())) m = int(input()) b = list(map(int,input().split())) if n < m: print('NO') exit() c = collections.Counter(b) for i, j in c.items(): for k in range(j): d = bisect.bisect_left(a, i) if a[d] == i: ...
s943363950
p03578
u768896740
1576957207
Python
Python (3.4.3)
py
Runtime Error
158
41700
423
import collections import bisect n = int(input()) a = list(map(int, input().split())) m = int(input()) b = list(map(int,input().split())) if n < m: print('No') exit() c = collections.Counter(b) for i, j in c.items(): for k in range(j): d = bisect.bisect_left(a, i) if a[d] == i: ...
s966015322
p03578
u864197622
1576952451
Python
Python (3.4.3)
py
Runtime Error
76
27100
283
input() D = {} for a in [int(a) for a in input().split()]: if a not in D: D[i] = 0 D[a] += 1 input() for a in [int(a) for a in input().split()]: if a not in D: D[i] = 0 D[a] -= 1 for a in D: if D[a] < 0: print("NO") break else: print("YES")
s538094176
p03578
u864197622
1576952373
Python
Python (3.4.3)
py
Runtime Error
73
27100
282
input() D = {} for a in [int(a) for a in input().split()]: if a not in D: D[i] = 0 D[i] += 1 input() for a in [int(a) for a in input().split()]: if a not in D: D[i] = 0 D[i] -= 1 for a in D: if D[a] < 0: print("NO") break else: print("YES")
s604014479
p03578
u644907318
1576524424
Python
Python (3.4.3)
py
Runtime Error
385
35164
334
N = int(input()) D = sorted(list(map(int,input().split()))) M = int(input()) T = sorted(list(map(int,input().split()))) cur = 0 flag = 0 for i in range(N): if cur<M and D[i]==T[cur]: cur += 1 elif D[i]<T[cur]: continue else: flag = 1 break if flag==0: print("YES") else: ...
s845854252
p03578
u047102107
1576463596
Python
PyPy3 (2.4.0)
py
Runtime Error
375
127568
386
from collections import Counter, defaultdict N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) memo = defaultdict(int) for d in D: memo[d] += 1 for i in range(m): ti = T[i] if ti not in memo: print("NO") exit() if memo[ti] == 0: ...
s770243853
p03578
u777283665
1575335820
Python
Python (3.4.3)
py
Runtime Error
226
46432
234
n = int(input()) x = dict() for i in input().split(): x[i] = x.get(i, 0) + 1 m = int(input()) for i in input().split(): if x[i] == 0 or i not in x: print("NO") exit() else: x[i] -= 1 print("YES")
s385851599
p03578
u777283665
1575335736
Python
Python (3.4.3)
py
Runtime Error
231
46432
234
n = int(input()) x = dict() for i in input().split(): x[i] = x.get(i, 0) + 1 m = int(input()) for i in input().split(): if x[i] == 0 or i not in x: print("NO") exit() else: x[i] -= 1 print("YES")
s059302703
p03578
u855781168
1575168344
Python
Python (3.4.3)
py
Runtime Error
153
34024
319
n = int(input()) d = list(map(lambda x: int(x),input().split())) m = int(input()) t = list(map(lambda x: int(x),input().split())) flag = 1 for elem in t: try: x = d.index(elem) except ValueError: flag = 0 break d.remove(ele_m) if flag == 0: print("No") else: print("Yes")
s060911978
p03578
u936985471
1575095513
Python
Python (3.4.3)
py
Runtime Error
18
2940
230
n=int(input()) d=sorted(list(map(int,input().split()))) m=int(input()) t=sorted(list(map(int,input().split()))) j=0 for i in range(len(t)): if j==len(s): print("NO") break t[i]==s[j]: j+=1 else: print("YES")
s093799790
p03578
u945181840
1574122938
Python
Python (3.4.3)
py
Runtime Error
59
34168
259
from collections import Counter N = int(input()) D = int, input().split() M = int(input()) T = input().split() d = Counter(D) t = Counter(T) for key, value in t.items(): if d.get(key, 0) < value: print('NO') exit() else: print('YES')
s734226796
p03578
u832152513
1573190247
Python
PyPy3 (2.4.0)
py
Runtime Error
432
127572
262
n = int(input()) d = list(map(int, input().split())) m = int(input()) t = list(map(int, input().split())) d.sort() t.sort() l = [0] * (d[-1] + 1) for i in d: l[i] += 1 for i in t: l[i] -= 1 l.sort() if l[0] >= 0: print("YES") else: print("NO")
s310014565
p03578
u668503853
1569087389
Python
Python (3.4.3)
py
Runtime Error
2105
35420
237
N=int(input()) D=list(map(int,input().split())) M=int(input()) T=list(map(int,input().split())) for i in range(N): if D[i] in T: T.remove(D[i]) D.pop(i) if len(T)==0: break if len(T)==0: print("YES") else: print("NO")
s947515813
p03578
u668503853
1569087343
Python
Python (3.4.3)
py
Runtime Error
2105
34476
241
N=int(input()) D=list(map(int,input().split())) M=int(input()) T=list(map(int,input().split())) for i in range(N): if D[i] in T: T.remove(D[i]) D.pop(i) if len(T)==0: break if len(T)==0: print("YES") else: print("NO")
s192799499
p03578
u296150111
1568910037
Python
Python (3.4.3)
py
Runtime Error
322
35556
202
n=int(input()) a=list(map(int,input().split())) m=int(input()) b=list(map(int,input().split())) a.sort() b.sort() j=0 for i in range(n): if a[i]==b[j]: j+=1 if j==m: print("YES") else: print("NO")
s379920371
p03578
u131634965
1567993966
Python
Python (3.4.3)
py
Runtime Error
2105
34024
396
n=int(input()) d=list(map(int, input().split())) m=int(input()) t=list(map(int, input().split())) d_dict={} for dd in d: if dd not in d_dict: d_dict[dd]=d.count(dd) t_dict={} for tt in t: if tt not in t_dict: t_dict[tt]=t.count(tt) for t_num in t_dict: if d_dict[t_num]>= t_dict[t_num]: ...
s983479762
p03578
u412481017
1567440422
Python
Python (3.4.3)
py
Runtime Error
141
35556
199
a=int(input()) b=list(map(int,input().split())) c=int(input()) d=list(map(int,input().split())) e=set(d) for item in e: if d.count(item)>c.count(item): print("NO") exit() print("YES")
s514501705
p03578
u412481017
1567383856
Python
PyPy3 (2.4.0)
py
Runtime Error
361
127568
242
n=int(input()) r=list(map(int,input().split())) m=int(input()) d=list(map(int,input().split())) e=set(d) from collections import Counter n=counter(n) d=counter(d) for item in e: if r[item]<d[item]: print("NO") exit() print("YES")
s477028002
p03578
u865413330
1567374630
Python
Python (3.4.3)
py
Runtime Error
2105
35116
272
N = input() nums = list(map(int, input().split())) nums.sort() M = input() tasks = list(map(int, input().split())) tasks.sort() ans = "YES" for task in tasks: if nums.index(task) != -1: nums.remove(task) else: ans = "NO" break print(ans)
s374997162
p03578
u865413330
1567374586
Python
Python (3.4.3)
py
Runtime Error
2105
35324
272
N = input() nums = list(map(int, input().split())) nums.sort() M = input() tasks = list(map(int, input().split())) tasks.sort() ans = "YES" for task in tasks: if nums.index(task) != -1: nums.remove(task) else: ans = "NO" break print(ans)
s295001224
p03578
u865413330
1567374501
Python
Python (3.4.3)
py
Runtime Error
271
35420
271
N = input() nums = list(map(int, input().split())) nums.sort() M = input() tasks = list(map(int, input().split())) tasks.sort() ans = "YES" for task in tasks: if nums.find(task) != -1: nums.remove(task) else: ans = "NO" break print(ans)
s892331017
p03578
u103902792
1564439927
Python
Python (3.4.3)
py
Runtime Error
324
37084
443
n = int(input()) ds = sorted(list(map(int,input().split()))) m = int(input()) ts = sorted(list(map(int,input().split()))) j = 0 for i in range(n): if ds[i+j] == ts[i]: continue elif ds[i+j] < ts[i]: for k in range(n - i+j): if ds[i+j+k] == ts[i]: j += k break elif ds[i+j+k] < ts...
s978297938
p03578
u103902792
1564434528
Python
Python (3.4.3)
py
Runtime Error
113
35156
199
n = int(input()) ds = list(map(int,input().split())) m = int(input()) ts = list(map(int,input().split())) for t in ts: if i in ds: ds.remove(t) else: print('NO') exit(0) print('YES')
s055759943
p03578
u444349080
1564168017
Python
Python (3.4.3)
py
Runtime Error
17
2940
471
#include <iostream> #include <math.h> #include <fstream> #include <algorithm> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> using namespace std; int main() { int N, M,a; map<int, int>m{}; bool flag = true; cin >> N; for (int i = 0; i < N; i++) { cin >> a;...
s774084642
p03578
u223646582
1562601311
Python
PyPy3 (2.4.0)
py
Runtime Error
2108
123348
261
import bisect N=int(input()) D=sorted([int(i) for i in input().split()]) M=int(input()) T=[int(i) for i in input().split()] for t in T: bl=bisect.bisect_left(D,t) if D[bl]==t: del D[bl] else: print('NO') exit() print('YES')
s453070295
p03578
u767664985
1561874689
Python
Python (3.4.3)
py
Runtime Error
114
35116
185
N = int(input()) D = list(map(int, input().split())) M = int(input()) T = list(map(int, input().split())) for i in T: if i in D: remove(i) else: print("No") exit() print("Yes")
s980594167
p03578
u102461423
1560810342
Python
Python (3.4.3)
py
Runtime Error
291
56928
233
from collections import Counter N = int(input()) D = [int(x) for x in input().split()] M = int(input()) T = [int(x) for x in input().split()] c = Counter(D) - Counter(T) answer = 'YES' if min(c.values()) >= 0 else 'NO' print(answer)
s814642983
p03578
u315703650
1560280409
Python
Python (3.4.3)
py
Runtime Error
115
35420
302
n = int(input()) d = list(map(int,input().split())) m = int(input()) t = list(map(int,input().split())) dd=[0]*(max(d)+1) tt=[0]*(max(t)+1) for i in range(n): dd[d[i]]+=1 for i in range(m): tt[t[i]]+=1 for i in range(m): if tt[t[i]]>dd[t[i]]: print("NO") exit() print("YES")
s922475857
p03578
u136090046
1560123804
Python
Python (3.4.3)
py
Runtime Error
104
38360
354
n = int(input()) d_array = [int(x) for x in input().split()] d_dict = {} for i in range(200000+1): d_dict[i] = 0 for d in d_array: d_dict[d] += 1 m = int(input()) t_array = sorted([int(x) for x in input().split()]) for t in t_array: if d_dict[t] > 0: d_dict[t] -= 1 else: print("NO") ...
s748416737
p03578
u227476288
1559417824
Python
Python (3.4.3)
py
Runtime Error
86
27132
363
N = int(input()) D = [int(i)-1 for i in input().split()] Dlist = [0]*(max(D)+1) for d in D: Dlist[d] += 1 M = int(input()) T = [int(i)-1 for i in input().split()] Tlist = [0]*(max(T)+1) for t in T: Tlist[t] += 1 flag = True for i in T: if Tlist[i] > Dlist[i]: flag = False break if fl...
s277811589
p03578
u227476288
1559417651
Python
Python (3.4.3)
py
Runtime Error
79
27132
414
N = int(input()) D = [int(i) for i in input().split()] Dlist = [0]*max(D) for d in D: Dlist[d-1] += 1 M = int(input()) T = [int(i) for i in input().split()] if max(T) > max(D): print('NO') exit() Tlist = [0]*max(T) for t in T: Tlist[t-1] += 1 flag = True for i in T: i -= 1 if Tlist[i] > D...
s441953610
p03578
u227476288
1559417580
Python
Python (3.4.3)
py
Runtime Error
179
27100
379
N = int(input()) D = [int(i) for i in input().split()] Dlist = [0]*1000000 for d in D: Dlist[d-1] += 1 M = int(input()) T = [int(i) for i in input().split()] Tlist = [0]*1000000 for t in T: Tlist[t-1] += 1 flag = True for i in range(len(Tlist)): if Tlist[i] > Dlist[i]: flag = False ...
s641850603
p03578
u227476288
1559417533
Python
Python (3.4.3)
py
Runtime Error
77
27100
424
N = int(input()) D = [int(i) for i in input().split()] Dlist = [0]*max(D) for d in D: Dlist[d-1] += 1 M = int(input()) T = [int(i) for i in input().split()] if max(T) > max(D): print('NO') exit() Tlist = [0]*max(T) for t in T: Tlist[t-1] += 1 flag = True for i in range(len(Tlist)): if Tli...
s901451046
p03578
u227476288
1559416031
Python
Python (3.4.3)
py
Runtime Error
79
25576
364
N = int(input()) D = [int(i) for i in input().split()] Dlist = [0]*max(D) for d in D: Dlist[d-1] += 1 M = int(input()) T = [int(i) for i in input().split()] Tlist = [0]*max(T) for t in T: Tlist[t-1] += 1 flag = True for i in range(max(T)): if Tlist[i] > Dlist[i]: flag = False break if f...