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
s610388988
p02271
u318430977
1528641086
Python
Python3
py
Runtime Error
9920
5612
516
def solve(a, m): if len(a) == 0: if m == 0: return True else: return False else: if solve(a[1:], m - a[0]): return True else: return solve(a[1:], m) n = int(input()) tmp = input().split() a = [] for i in range(n): a.append(int...
s879582169
p02271
u318430977
1528641359
Python
Python3
py
Runtime Error
9910
5608
516
def solve(a, m): if len(a) == 0: if m == 0: return True else: return False else: if solve(a[1:], m - a[0]): return True else: return solve(a[1:], m) n = int(input()) tmp = input().split() a = [] for i in range(n): a.append(int...
s409552701
p02271
u318430977
1528641693
Python
Python3
py
Runtime Error
0
0
472
def solve(a, m): if m < 0 or m > sumA: return False if m == 0: return True if len(a) == 0: return False return solve(a[1:], m - a[0]) or solve(a[1:], m) n = int(input()) tmp = input().split() a = [] for i in range(n): a.append(int(tmp[i])) q = int(input()) tmp = input().spl...
s846456333
p02271
u559106458
1529249781
Python
Python3
py
Runtime Error
0
0
289
int n list=[] int q,M,i n=input() i=0 while i<n: list.append(input()) i=i+1 q=input() i=0 while i<q: M=input() if(solve(0,M)): print("yes\n") else: print("no\n") i=i+1 def solve(i,m) if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) || solve(i+1, m-list[i]) return res
s702692571
p02271
u559106458
1529250781
Python
Python3
py
Runtime Error
0
0
313
int n def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes\n") else: print("no\n") i=i+1
s414054383
p02271
u559106458
1529250803
Python
Python3
py
Runtime Error
0
0
309
int n def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes") else: print("no") i=i+1
s628310495
p02271
u559106458
1529250821
Python
Python3
py
Runtime Error
0
0
303
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes") else: print("no") i=i+1
s549553204
p02271
u559106458
1529250840
Python
Python3
py
Runtime Error
0
0
307
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes\n") else: print("no\n") i=i+1
s829915183
p02271
u559106458
1529250924
Python
Python3
py
Runtime Error
0
0
303
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes") else: print("no") i=i+1
s529344973
p02271
u559106458
1529251014
Python
Python3
py
Runtime Error
0
0
303
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes") else: print("no") i=i+1
s580531119
p02271
u559106458
1529251128
Python
Python3
py
Runtime Error
0
0
312
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes") else: print("no") i=i+1 return 0
s713613371
p02271
u559106458
1529251222
Python
Python3
py
Runtime Error
0
0
302
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res = solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes") else: print("no") i=i+1
s998714906
p02271
u559106458
1529251404
Python
Python3
py
Runtime Error
0
0
302
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res=solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes"); else: print("no"); i=i+1
s943263844
p02271
u559106458
1529251421
Python
Python
py
Runtime Error
0
0
302
def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res=solve(i+1,m) or solve(i+1, m-int(list[i])) return res n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes"); else: print("no"); i=i+1
s454093777
p02271
u559106458
1529251490
Python
Python3
py
Runtime Error
0
0
302
n=0 list=[] q=0 M=0 n=int(input()) i=0 while i<n: list.append(input()) i=i+1 q=int(input()) def solve(i,m): if(m==0):return 1 if(i>=n):return 0 res=solve(i+1,m) or solve(i+1, m-int(list[i])) return res i=0 while i<q: M=int(input()) if(solve(0,M)): print("yes"); else: print("no"); i=i+1
s567378033
p02271
u971076135
1529371304
Python
Python3
py
Runtime Error
480
5616
692
def stdinput(): from sys import stdin return stdin.readline().strip() def main(): n = int(stdinput()) A = list(sorted(map(int, stdinput().split(' ')))) q = int(stdinput()) M = list(map(int, stdinput().split(' '))) for m in M: if check(m, A): print('yes') else: ...
s201741329
p02271
u971076135
1529371874
Python
Python3
py
Runtime Error
11170
5620
710
def stdinput(): from sys import stdin return stdin.readline().strip() def main(): n = int(stdinput()) A = list(sorted(map(int, stdinput().split(' ')))) q = int(stdinput()) M = list(map(int, stdinput().split(' '))) for m in M: if check(m, 0, A): print('yes') else...
s604205940
p02271
u971076135
1529372263
Python
Python3
py
Runtime Error
11020
5620
756
def stdinput(): from sys import stdin return stdin.readline().strip() def main(): n = int(stdinput()) A = list(sorted(map(int, stdinput().split(' ')), reverse=True)) q = int(stdinput()) M = list(map(int, stdinput().split(' '))) for m in M: if check(m, 0, list(filter(lambda a: a <= ...
s245806783
p02271
u007270338
1529972101
Python
Python3
py
Runtime Error
0
0
621
#coding:utf-8 import numpy as np n = int(input()) A = list(map(int,input().split())) q = int(input()) mList = list(map(int,input().split())) dp = [[False for i in range(2000)] for j in range(20)] dp = np.array(dp) def solve(i,m): if dp[i,m]: return dp[i,m] if m == 0: dp[i,m] = True elif ...
s523155602
p02271
u007270338
1529972328
Python
Python3
py
Runtime Error
15920
5948
593
#coding:utf-8 n = int(input()) A = list(map(int,input().split())) q = int(input()) mList = list(map(int,input().split())) dp = [[False for i in range(2000)] for j in range(20)] def solve(i,m): if dp[i][m]: return dp[i][m] if m == 0: dp[i][m] = True elif i >= n or m < 0: dp[i][m] ...
s499670596
p02271
u007270338
1529972797
Python
Python3
py
Runtime Error
0
0
638
#coding:utf-8 import numpy as np n = int(input()) A = list(map(int,input().split())) q = int(input()) mList = list(map(int,input().split())) dp = [[False for i in range(2001)] for j in range(21)] dp = np.array(dp) def solve(i,m): if dp[i,m]: return dp[i,m] if m < 0: return if m == 0: ...
s781835347
p02271
u007270338
1529972860
Python
Python3
py
Runtime Error
17450
5948
609
#coding:utf-8 n = int(input()) A = list(map(int,input().split())) q = int(input()) mList = list(map(int,input().split())) dp = [[False for i in range(2001)] for j in range(21)] def solve(i,m): if dp[i][m]: return dp[i][m] if m < 0: return if m == 0: dp[i][m] = True elif i >= ...
s925059048
p02271
u751769081
1530069618
Python
Python3
py
Runtime Error
8190
5616
378
def solve(i, m): if m == 0: return True if i >= n: return False res = solve(i + 1, m) or solve(i + 1, m - A[i]) return res n = int(input()) A = [int(e) for e in input().split()] q = int(input()) M = [int(e) for e in input().split()] for m in M: result = solve(0, m) if result == ...
s851318645
p02271
u424720817
1530236885
Python
Python3
py
Runtime Error
12160
5608
423
n = int(input()) a = list(map(int, input().split())) q = int(input()) m = list(map(int, input().split())) def main(): for number in m: if solve(0, number): print('yes') else : print('no') def solve(i, m): if m == 0: return 1 if i >= n: return 0 ...
s184939598
p02271
u424720817
1530237296
Python
Python3
py
Runtime Error
12860
5612
423
n = int(input()) a = list(map(int, input().split())) q = int(input()) m = list(map(int, input().split())) def main(): for number in m: if solve(0, number): print('yes') else : print('no') def solve(i, m): if m == 0: return 1 if i >= n: return 0 ...
s355659689
p02271
u424720817
1530238802
Python
Python3
py
Runtime Error
11850
5612
458
n = int(input()) a = list(map(int, input().split())) q = int(input()) m = list(map(int, input().split())) def main(): for number in m: if solve(n - 1, 0, number): print('yes') else : print('no') def solve(i, m, number): if m == number: return 1 if i < 0: ...
s640630081
p02271
u424720817
1530241193
Python
Python3
py
Runtime Error
7500
5612
424
n = int(input()) a = list(map(int, input().split())) q = int(input()) m = list(map(int, input().split())) def main(): for number in m: if solve(0, number): print('yes') else : print('no') def solve(i, m): if m == 0: return 1 if i >= n: return 0 ...
s277525725
p02271
u424720817
1530241318
Python
Python3
py
Runtime Error
7930
5612
431
n = int(input()) a = list(map(int, input().split())) q = int(input()) m = list(map(int, input().split())) def main(): for number in m: if solve(0, number): print('yes') else : print('no') def solve(i, m): if m == 0: return True if i >= n: return Fal...
s324991169
p02271
u298224238
1530242717
Python
Python3
py
Runtime Error
0
0
33
from numba.decorators import jit
s784418976
p02271
u300095814
1530249358
Python
Python3
py
Runtime Error
7530
5608
321
aN = int(input()) A = list(map(int, input().split())) mN = int(input()) M = list(map(int, input().split())) def solve(i, m): if m == 0: return True if i >= aN: return False res = solve(i + 1, m) or solve(i + 1, m - A[i]) return res for m in M: print("yes" if solve(0, m) else "no")...
s275545625
p02271
u300095814
1530249370
Python
Python3
py
Runtime Error
7450
5608
321
aN = int(input()) A = list(map(int, input().split())) mN = int(input()) M = list(map(int, input().split())) def solve(i, m): if m == 0: return True if i >= aN: return False res = solve(i + 1, m) or solve(i + 1, m - A[i]) return res for m in M: print("yes" if solve(0, m) else "no")...
s553562840
p02271
u300095814
1530249375
Python
Python3
py
Runtime Error
7590
5612
321
aN = int(input()) A = list(map(int, input().split())) mN = int(input()) M = list(map(int, input().split())) def solve(i, m): if m == 0: return True if i >= aN: return False res = solve(i + 1, m) or solve(i + 1, m - A[i]) return res for m in M: print("yes" if solve(0, m) else "no")...
s389190795
p02271
u657361950
1530622557
Python
Python3
py
Runtime Error
14460
5612
524
def solve(arr, target): return solve_rec(0, arr, target) def solve_rec(i, arr, target): if target == 0: return True if i >= len(arr): return False res1 = solve_rec(i + 1, arr, target) res2 = solve_rec(i + 1, arr, target - arr[i]) if res1 == True or res2 == True: return True return False n = int(input(...
s869467631
p02271
u657361950
1530622649
Python
Python3
py
Runtime Error
14300
5612
524
def solve(arr, target): return solve_rec(0, arr, target) def solve_rec(i, arr, target): if target == 0: return True if i >= len(arr): return False res1 = solve_rec(i + 1, arr, target) res2 = solve_rec(i + 1, arr, target - arr[i]) if res1 == True or res2 == True: return True return False n = int(input(...
s331037758
p02271
u657361950
1530622857
Python
Python3
py
Runtime Error
0
0
481
def solve(arr, target): return solve_rec(0, arr, target) def solve_rec(i, arr, target): if target == 0: return True if i >= len(arr): return False res1 = solve_rec(i + 1, arr, target) res2 = solve_rec(i + 1, arr, target - arr[i] return res1 or res2 n = int(input()) arr = list(map(int, input().split())) q ...
s651083107
p02271
u657361950
1530622923
Python
Python3
py
Runtime Error
13110
5612
482
def solve(arr, target): return solve_rec(0, arr, target) def solve_rec(i, arr, target): if target == 0: return True if i >= len(arr): return False res1 = solve_rec(i + 1, arr, target) res2 = solve_rec(i + 1, arr, target - arr[i]) return res1 or res2 n = int(input()) arr = list(map(int, input().split())) q...
s544915570
p02271
u657361950
1530631862
Python
Python3
py
Runtime Error
12620
5612
480
def solve(arr, target): return solve_rec(0, arr, target) def solve_rec(i, arr, target): if target == 0: return True if i >= len(arr): return False res1 = solve_rec(i + 1, arr, target) res2 = solve_rec(i + 1, arr, target - arr[i]) return res1 or res2 n = int(input()) arr = list(map(int, input().split())) q ...
s435861772
p02271
u782850731
1379936772
Python
Python
py
Runtime Error
20000
4256
507
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin def solve(a, al, m, i): if m == 0: return True if m > 0 and i < al: if solve(a, al, m-a[i], i+1) or solve(a, al, m, i+1): return True return False stdin.readline() a = [int(s) for s in...
s980116631
p02271
u782850731
1379940524
Python
Python
py
Runtime Error
20000
4256
527
#!/usr/bin/env python from __future__ import division, print_function from sys import stdin def solve(a, al, m, i): if not m: return True if m > 0 and i < al: if solve(a, al, m-a[i], i+1) or solve(a, al, m, i+1): return True return False stdin.readline() a = [int(s) for s in ...
s488515679
p02271
u140201022
1389737613
Python
Python
py
Runtime Error
0
0
644
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import print_function,division from itertools import combinations import time import sys import io import re import math start = time.clock() i = 0 def enum_sum_numbers(sets, s_range, r): for cmb in combinations(sets,r): yield sum(cmb) if r <=...
s753064949
p02272
u269568674
1530850640
Python
Python3
py
Runtime Error
1400
27308
607
cnt = 0 def merge(l, left, mid, right): L = l[left:mid] + [1000000] R = l[mid:right] + [1000000] i = 0 j = 0 for k in range(left, right): global cnt cnt += 1 if L[i] <= R[j]: l[k] = L[i] i += 1 else: l[k] = R[j] j += 1 ...
s703329531
p02272
u269568674
1530850720
Python
Python3
py
Runtime Error
30
5712
602
cnt = 0 def merge(l, left, mid, right): L = l[left:mid] + [10000] R = l[mid:right] + [10000] i = 0 j = 0 for k in range(left, right): global cnt cnt += 1 if L[i] <= R[j]: l[k] = L[i] i += 1 else: l[k] = R[j] j += 1 def ...
s722861454
p02272
u269568674
1530850746
Python
Python3
py
Runtime Error
20
5716
602
cnt = 0 def merge(l, left, mid, right): L = l[left:mid] + [2**10] R = l[mid:right] + [2**10] i = 0 j = 0 for k in range(left, right): global cnt cnt += 1 if L[i] <= R[j]: l[k] = L[i] i += 1 else: l[k] = R[j] j += 1 def ...
s424928988
p02272
u269568674
1530850784
Python
Python3
py
Runtime Error
0
0
614
EXTRA 10000 cnt = 0 def merge(l, left, mid, right): L = l[left:mid] + [EXTRA] R = l[mid:right] + [EXTRA] i = 0 j = 0 for k in range(left, right): global cnt cnt += 1 if L[i] <= R[j]: l[k] = L[i] i += 1 else: l[k] = R[j] ...
s424937375
p02272
u269568674
1530850812
Python
Python3
py
Runtime Error
30
5716
616
EXTRA = 10000 cnt = 0 def merge(l, left, mid, right): L = l[left:mid] + [EXTRA] R = l[mid:right] + [EXTRA] i = 0 j = 0 for k in range(left, right): global cnt cnt += 1 if L[i] <= R[j]: l[k] = L[i] i += 1 else: l[k] = R[j] ...
s020038592
p02272
u153665391
1532093991
Python
Python3
py
Runtime Error
0
0
869
N = int(input()) A = list(map(int, input().split())) INFTY = 1000000001 cnt = [0] def merge(left, mid, right): n1 = mid - left n2 = right - mid L = [0 for _ in range(n1+1)] R = [0 for _ in range(n2+1)] for i in range(n1): L[i] = A[left+i] for i in range(n2): R[i] = A[mid+i] ...
s844799859
p02272
u125481461
1541129890
Python
Python3
py
Runtime Error
0
0
992
import sys compare_counter = 0 array = [0 for x in range(500000)] def merge(left, mid, right): n_fore = mid - left n_rear = right - mid l_fore = array[left:left + n_fore] l_fore.append(sys.maxsize) l_rear = array[mid:mid + n_rear] l_rear.append(sys.maxsize) i = j = 0 global compare_co...
s216727958
p02272
u803657704
1545366666
Python
Python3
py
Runtime Error
0
0
823
cnt = 0 def merge(A, left, mid, right): global cnt #print("marge ",A,left,mid,right) n1 = mid - left n2 = right - mid #L = [0] * (n1+1) #R = [0] * (n2+1) L = [0] * (n1+1) R = [0] * (n2+1) for i in range(int(n1)): L[i] = A[left + i] for i in range(int(n2)): R[i] = A[mid + i] L[n1] = 9999...
s181456353
p02272
u357267874
1559046787
Python
Python3
py
Runtime Error
1510
27412
923
count = 0 def merge(A, left, mid, right): n1 = mid - left n2 = right - mid L = A[left:mid] R = A[mid:right] # print('merge for', left, 'to', right) L.append(1000000) R.append(1000000) # print('n1', n1) # print('n2', n2) # print('L', L) # print('R', R) i = 0 j =...
s806256081
p02272
u357267874
1559051604
Python
Python3
py
Runtime Error
1430
27408
923
count = 0 def merge(A, left, mid, right): n1 = mid - left n2 = right - mid L = A[left:mid] R = A[mid:right] # print('merge for', left, 'to', right) L.append(1000000) R.append(1000000) # print('n1', n1) # print('n2', n2) # print('L', L) # print('R', R) i = 0 j =...
s264607413
p02272
u357267874
1559051962
Python
Python3
py
Runtime Error
1370
27404
669
def merge(A, left, mid, right): L = A[left:mid] R = A[mid:right] L.append(1000000) R.append(1000000) i = 0 j = 0 global count for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] ...
s859979945
p02272
u357267874
1559052000
Python
Python3
py
Runtime Error
1470
27560
697
def merge(A, left, mid, right): L = A[left:mid] + [1000000] R = A[mid:right] + [1000000] # L.append(1000000) # R.append(1000000) i = 0 j = 0 global count for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 else...
s500133784
p02272
u357267874
1559052069
Python
Python3
py
Runtime Error
0
0
1031
# def merge(A, left, mid, right): # L = A[left:mid] + [1000000] # R = A[mid:right] + [1000000] # # L.append(1000000) # # R.append(1000000) # i = 0 # j = 0 # global count # for k in range(left, right): # count += 1 # if L[i] <= R[j]: # A[k] = L[i] # ...
s115045392
p02272
u357267874
1559052470
Python
Python3
py
Runtime Error
1370
27564
1084
def merge(A, left, mid, right): L = A[left:mid] + [1000000] R = A[mid:right] + [1000000] # L.append(1000000) # R.append(1000000) i = 0 j = 0 global count for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 else...
s160075462
p02272
u357267874
1559052579
Python
Python3
py
Runtime Error
1370
27572
1067
def merge_jibun(A, left, mid, right): L = A[left:mid] + [1000000] R = A[mid:right] + [1000000] # L.append(1000000) # R.append(1000000) i = 0 j = 0 global count for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 ...
s202319793
p02272
u357267874
1559052685
Python
Python3
py
Runtime Error
1360
27572
1109
def merge_jibun(A, left, mid, right): L = A[left:mid] + [1000000] R = A[mid:right] + [1000000] # L.append(1000000) # R.append(1000000) i = 0 j = 0 global count for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 ...
s486546845
p02272
u357267874
1559052730
Python
Python3
py
Runtime Error
1350
27576
1114
def merge_jibun(A, left, mid, right): global count L = A[left:mid] + [1000000] R = A[mid:right] + [1000000] # L.append(1000000) # R.append(1000000) i = 0 j = 0 for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 ...
s213356873
p02272
u357267874
1559052772
Python
Python3
py
Runtime Error
1410
27568
1114
def merge_jibun(A, left, mid, right): global count L = A[left:mid] + [1000000] R = A[mid:right] + [1000000] # L.append(1000000) # R.append(1000000) i = 0 j = 0 for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] i += 1 ...
s746452414
p02272
u357267874
1559052911
Python
Python3
py
Runtime Error
30
5628
1134
def merge_jibun(A, left, mid, right): global count # inf = 10 ** 9 L = A[left:mid] + [10 ** 4] R = A[mid:right] + [10 ** 4] # L.append(1000000) # R.append(1000000) i = 0 j = 0 for k in range(left, right): count += 1 if L[i] <= R[j]: A[k] = L[i] ...
s262543685
p02272
u604774382
1438252791
Python
Python3
py
Runtime Error
0
0
649
def merge( tS, left, mid, right ): global cnt n1 = mid - left; n2 = right - mid; tL = tS[ left : mid ]; tR = tS[ mid : right ]; tL.append( 1000000001 ) tR.append( 1000000001 ) i = j = 0 for k in range( left, right ): cnt += 1 if tL[i] <= tR[j]: tS[k] = tL[i] i += 1 else: tS[k] = tR[j] j += 1...
s708868601
p02272
u885889402
1442377786
Python
Python3
py
Runtime Error
2190
30484
762
m=0 def merge(a,left,mid,right): n1=mid-left n2=right-mid el=list(range(0,n1+1)) ar=list(range(0,n2+1)) for i in range(n1): el[i]=a[left+i] for i in range(n2): ar[i]=a[mid+i] el[n1]=20*10000 ar[n2]=20*10000 i=0 j=0 for k in range(left,right): global m ...
s130281519
p02272
u885889402
1442380213
Python
Python
py
Runtime Error
0
0
845
m=0 def merge(a,left,mid,right): n1=mid-left n2=right-mid el=range(0,n1+1) ar=range(0,n2+1) for i in range(n1): el[i]=a[left+i] for i in range(n2): ar[i]=a[mid+i] el[n1]=float("inf") ar[n2]=float("inf") i=0 j=0 for k in range(left,right): global m ...
s735365731
p02272
u731976921
1442381009
Python
Python3
py
Runtime Error
0
0
757
INFTY = 10 ** 10 def merge(A, left, mid, right): global count n1 = mid - left; n2 = right - mid; L = [] R = [] L = A[left:left+n1] R = A[mid:mid+n2] L.append(INFTY) R.append(INFTY) i = 0 j = 0 for k in range(left, right): count = count + 1 if L[i] <= R[j]: A[k] = L[i] i ...
s251447322
p02272
u253463900
1442381356
Python
Python3
py
Runtime Error
0
0
924
count = 0 def marge(A,left,mid,right): global count n1 = mid -left n2 = right -mid L = [] R = [] j=0 for i in range(left,n1+left): L[j]=A[i] j += 1 L[j+1] = float("inf") j=0 for i in range(mid,n2+mid): R[j]=A[i] j += 1 R[j+1] = float("inf") ...
s787878150
p02272
u197445199
1442382284
Python
Python
py
Runtime Error
0
0
966
N = int(raw_input()) count = 0 A_str = raw_input().split() A = map(int, A_str) def merge(left, right): global count sorted_list = [] l_index = 0 r_index = 0 while l_index < len(left) and r_index < len(right): count += 1 if left[l_index] <= right[r_index]: sorted_list.a...
s578023582
p02272
u197445199
1442382304
Python
Python
py
Runtime Error
0
0
978
N = int(raw_input()) count = 0 A_str = raw_input().split() A = map(int, A_str) def merge(left, right): global count sorted_list = [] l_index = 0 r_index = 0 while l_index < len(left) and r_index < len(right): count += 1 if left[l_index] <= right[r_index]: sorted_list.a...
s449045868
p02272
u854228079
1442384796
Python
Python
py
Runtime Error
0
0
1054
global count acount = 0 def merge(num_list, left, mid, right): a = mid - left b = right - mid L = [] R = [] for i in range(a): L.append(num_list[left + i]) for i in range(b): R.append(num_list[mid + i]) L.append(float("inf")) R.append(float("inf")) i = 0 j = ...
s212881179
p02272
u488601719
1448720286
Python
Python3
py
Runtime Error
0
0
1872
def merge(A, left, mid, right): global count L = A[left:mid] R = A[mid:right] R.append[1000000001] L.append[1000000001] i = j = 0 for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] j += 1 cou...
s900729887
p02272
u247279609
1459310081
Python
Python
py
Runtime Error
0
0
794
count = 0 def mergeSort(A, left, right): if left + 1 < right: mid = (left + right)/2 mergeSort(A, left, mid) mergeSort(A, mid, right) merge(A, left, mid, right) def merge(A, left, mid, right): n1 = mid -left n2 = right - mid L = [0] * (n1+1) R = [0] * (n2+1) for...
s057195260
p02272
u963402991
1459387955
Python
Python3
py
Runtime Error
2120
29424
820
def merge(A, left, mid, right): n1 = mid - left n2 = right - mid L = [A[left + i] for i in range(n1)] R = [A[mid + i] for i in range(n2)] # ?????? L.append(500001) R.append(500001) i, j, c = 0, 0, 0 for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] ...
s101399912
p02272
u963402991
1459388674
Python
Python3
py
Runtime Error
0
0
759
def merge(A, left, mid, right): global count n1 = mid - left n2 = right - mid banpei = 10 ** 9 + 1 L, R = L + [banpei], R + [banpei] L = [A[left + i] for i in range(n1)] R = [A[mid + i] for i in range(n2)] i, j = 0, 0 for k in range(left, right): if L[i] <= R[j]: ...
s813931990
p02272
u670498238
1466217955
Python
Python3
py
Runtime Error
0
0
813
sentinel = 10**10 def Merge(A, left, mid, right): n1 = mid - left n2 = right - mid L = [0 for x in range(n1 + 1)] R = [0 for x in range(n2 + 1)] L[n1] = sentinel R[n2] = sentinel for i in range(n1): L[i] = A[left + i] for i in range(n2): R[i] = A[mid + i] i = 0 ...
s031652912
p02272
u742013327
1477457577
Python
Python3
py
Runtime Error
0
0
932
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_B&lang=jp count = 0 def merge(l,r): global count l_index = 0 r_index = 0 merge_list = [] l.append(pow(10,9) + 1) r.append(pow(10,9) + 1) for k in range(len(l) + len(r) - 2): count += 1 if l[l_index] < r[r_inde...
s408307040
p02272
u742013327
1477457819
Python
Python3
py
Runtime Error
0
0
932
#http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_5_B&lang=jp count = 0 def merge(l,r): global count l_index = 0 r_index = 0 merge_list = [] l.append(pow(10,9) + 1) r.append(pow(10,9) + 1) for k in range(len(l) + len(r) - 2): count += 1 if l[l_index] < r[r_inde...
s176035452
p02272
u216804574
1479027492
Python
Python3
py
Runtime Error
0
0
120
h, w = [int(n) for n in input().split()] for i in range(0, h): for j in range(0, w): print("#", end='') print()
s458985651
p02272
u195186080
1480690599
Python
Python3
py
Runtime Error
0
0
665
counter = 0 def merge(L, R, left, right): A=[] L.append(float('inf')) R.append(float('inf')) i,j=(0,0) global counter for n in range(0,right-left): counter = counter+1 if L[i]<=R[j]: A[n]=L[i] i=i+1 else: A[n]=R[j] j=j+1 ...
s047162571
p02272
u195186080
1480691572
Python
Python3
py
Runtime Error
0
0
684
counter = 0 def merge(L, R, left, right): A = range(0,right-left) L.append(float('inf')) R.append(float('inf')) i,j=(0,0) global counter for n in range(0,right-left): counter = counter+1 if L[i]<=R[j]: A[n]=L[i] i=i+1 else: A[n]=R[j] ...
s169613949
p02272
u711765449
1486295901
Python
Python3
py
Runtime Error
0
0
877
import math n = int(input()) S = list(map(int,input().split())) def merge(A, left, mid, right): global count n1 = mid - left n2 = right - mid L = [] for i in range(n1+1): L.append(i) R = [] for i in range(n2+1): R.append(i) for i in range(n1): L[i] = A[left + i] ...
s734181417
p02272
u711765449
1486296003
Python
Python3
py
Runtime Error
0
0
877
import math n = int(input()) S = list(map(int,input().split())) def merge(A, left, mid, right): global count n1 = mid - left n2 = right - mid L = [] for i in range(n1+1): L.append(i) R = [] for i in range(n2+1): R.append(i) for i in range(n1): L[i] = A[left + i] ...
s555046166
p02272
u831244171
1487510804
Python
Python3
py
Runtime Error
0
0
677
from collections import deque count = 0 def merge(A,left,mid,right): L = deque(A[left:mid]) R = deque(A[mid:right]) L.append(10**9) R.append(10**9) global count for k in range(left,right): count +=1 if L[0] <= R[0]: A[k] = L.popleft() else: ...
s996229929
p02272
u148628801
1487661732
Python
Python3
py
Runtime Error
0
0
1021
import sys def merge(A, left, mid, right, num_compare): n1 = mid - left n2 = right - mid L = [0 for i in range(n1)] R = [0 for i in range(n2)] for i in range(n1): L[i] = A[left + i] for i in range(n2): R[i] = A[mid + i] i = 0 j = 0 num_compare += right - left for k in range(left, right): if j >= ...
s983472725
p02272
u148628801
1487663228
Python
Python3
py
Runtime Error
0
0
912
import sys def merge(A, left, mid, right, num_compare): n1 = mid - left n2 = right - mid L = A[left:mid] + [SENTINEL] R = A[mid:right] + [SENTINEL] i = 0 j = 0 num_compare += right - left for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] j += 1 return num_c...
s040246025
p02272
u854976463
1488846467
Python
Python
py
Runtime Error
0
0
1993
global cmt cmt = 0 def Merge(left, right): global cnt lst = [] ...
s332628015
p02272
u301461168
1489599319
Python
Python3
py
Runtime Error
2170
31132
934
def merge(A, left, mid, right, cnt): n1 = mid - left n2 = right - mid L = [0 for i in range(n1+1)] R = [0 for i in range(n2+1)] for i in range(n1): L[i] = A[left + i] for i in range(n2): R[i] = A[mid + i] L[n1]=100000000 R[n2]=100000000 cnt1 = 0 ...
s222883915
p02272
u301461168
1489599503
Python
Python3
py
Runtime Error
2150
29460
939
def merge(A, left, mid, right, cnt): n1 = mid - left n2 = right - mid L = [0 for i in range(n1+1)] R = [0 for i in range(n2+1)] for i in range(n1): L[i] = A[left + i] for i in range(n2): R[i] = A[mid + i] L[n1]=100000000 R[n2]=100000000 cnt1 = 0 ...
s164869360
p02272
u301461168
1489599773
Python
Python3
py
Runtime Error
2100
29424
913
def merge(A, left, mid, right): n1 = mid - left n2 = right - mid L = [0 for i in range(n1+1)] R = [0 for i in range(n2+1)] for i in range(n1): L[i] = A[left + i] for i in range(n2): R[i] = A[mid + i] L[n1]=100000000 R[n2]=100000000 cnt1 = 0 cn...
s735340627
p02272
u300946041
1490612406
Python
Python3
py
Runtime Error
0
0
950
# -*- coding: utf-8 -*- count = 0 left_arr = [] right_arr = [] def merge(a, n, left, mid, right): n1 = mid - left for i in range(n1): left_arr[i] = a[left + 1] n2 = right - mid for i in range(n2): right_arr[i] = a[mid + i] left_arr[n1] = right_arr[n2] = 20 * 1000000 i = j =...
s948418073
p02272
u300946041
1490671435
Python
Python3
py
Runtime Error
0
0
1035
# -*- coding: utf-8 -*- infinity = 10 ** 9 def merge(ns, left, mid, right, count): n1 = mid - left n2 = right - mid left_ns = [e for e in range(n1)] right_ns = [e for e in range(n2)] for i in range(n1): left_ns[i] = ns[left + i] for i in range(n2): right_ns[i] = ns[mid + i] ...
s376115164
p02272
u300946041
1490671674
Python
Python3
py
Runtime Error
0
0
972
# -*- coding: utf-8 -*- infinity = 10 ** 9 count = 0 def merge(ns, left, mid, right): n1 = mid - left n2 = right - mid left_ns = [e for e in range(n1)] right_ns = [e for e in range(n2)] for i in range(n1): left_ns[i] = ns[left + i] for i in range(n2): right_ns[i] = ns[mid + i...
s410493008
p02272
u300946041
1490673712
Python
Python3
py
Runtime Error
0
0
1042
# -*- coding: utf-8 -*- infinity = pow(10, 9) + 1 def merge(ns, left, mid, right): global count n1 = mid - left n2 = right - mid # left_ns = [e for e in range(n1 + 1)] # right_ns = [e for e in range(n2 + 1)] left_ns = ns[left:mid] right_ns = ns[mid:right] # for i in range(n1): # ...
s814794020
p02272
u130834228
1490871419
Python
Python3
py
Runtime Error
0
0
764
def merge(A, left, mid, right): n1 = mid-left n2 = right-mid L = [0 for i in range(n1)] R = [0 for i in range(n2)] for i in range(n1): L[i] = A[left+i] for i in range(n2): R[i] = A[mid+i] L[n1] = inf R[n2] = inf i = 0 j = 0 for k in range(left, right): ...
s806559075
p02272
u130834228
1491046459
Python
Python3
py
Runtime Error
2280
29384
914
def merge(A, left, mid, right): n1 = mid-left n2 = right-mid L = [0 for i in range(n1+1)] R = [0 for i in range(n2+1)] for i in range(n1): L[i] = A[left+i] for i in range(n2): R[i] = A[mid+i] L[n1] = 100000001 R[n2] = 100000001 i = 0 j = 0 #global cnt cnt...
s119224255
p02272
u130834228
1491046503
Python
Python3
py
Runtime Error
2290
29296
914
def merge(A, left, mid, right): n1 = mid-left n2 = right-mid L = [0 for i in range(n1+1)] R = [0 for i in range(n2+1)] for i in range(n1): L[i] = A[left+i] for i in range(n2): R[i] = A[mid+i] L[n1] = 100000001 R[n2] = 100000001 i = 0 j = 0 #global cnt cnt...
s205605474
p02272
u546285759
1491383465
Python
Python3
py
Runtime Error
1660
29268
635
def merge(A, left, mid, right): global cnt inf = 5000001 n1, n2 = mid - left, right - mid L, R = A[left:left+n1]+[inf], A[mid:mid+n2]+[inf] i = j = 0 for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] ...
s881669549
p02272
u546285759
1491383532
Python
Python3
py
Runtime Error
1640
29232
636
def merge(A, left, mid, right): global cnt inf = 50000001 n1, n2 = mid - left, right - mid L, R = A[left:left+n1]+[inf], A[mid:mid+n2]+[inf] i = j = 0 for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] ...
s639539595
p02272
u546285759
1491383575
Python
Python3
py
Runtime Error
1650
29312
637
def merge(A, left, mid, right): global cnt inf = 500000001 n1, n2 = mid - left, right - mid L, R = A[left:left+n1]+[inf], A[mid:mid+n2]+[inf] i = j = 0 for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] ...
s239441587
p02272
u546285759
1491383688
Python
Python3
py
Runtime Error
1670
29288
645
def merge(A, left, mid, right): global cnt inf = 500000001 n1, n2 = mid - left, right - mid L, R = A[left:left+n1]+[inf], A[mid:mid+n2]+[inf] i = j = 0 for k in range(left, right): if L[i] <= R[j]: A[k] = L[i] i += 1 else: A[k] = R[j] ...
s866306754
p02272
u130834228
1492064264
Python
Python3
py
Runtime Error
0
0
842
def merge(A, left, mid, right): n1 = mid-left n2 = right-mid L = [0 for i in range(n1+1)] R = [0 for i in range(n2+1)] for i in range(n1): L[i] = A[left+i] for i in range(n2): R[i] = A[mid+i] L[n1] = float('inf') R[n2] = float('inf') i = 0 j = 0 global cnt ...
s182381628
p02272
u130834228
1492064466
Python
Python3
py
Runtime Error
0
0
893
def merge(A, left, mid, right): #n1 = mid-left #n2 = right-mid #L = [0 for i in range(n1+1)] #R = [0 for i in range(n2+1)] #for i in range(n1): # L[i] = A[left+i] #for i in range(n2): # R[i] = A[mid+i] L = A[left:mid] R = A[mid:right] L[n1] = float('inf') R[n2] = f...
s325566691
p02272
u130834228
1492064485
Python
Python3
py
Runtime Error
0
0
891
def merge(A, left, mid, right): n1 = mid-left n2 = right-mid #L = [0 for i in range(n1+1)] #R = [0 for i in range(n2+1)] #for i in range(n1): # L[i] = A[left+i] #for i in range(n2): # R[i] = A[mid+i] L = A[left:mid] R = A[mid:right] L[n1] = float('inf') R[n2] = flo...