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
s880543787
p02267
u735204496
1505025154
Python
Python
py
Runtime Error
0
0
261
import sys n = int(sys.stdin.readline().strip()) S = map(int, sys.stdin.readline().strip().split(" ")) n = int(sys.stdin.readline().strip()) T = map(int, sys.stdin.readline().strip().split(" ")) res = [] for t in T: rse.append(S.count(t)) print sum(res)
s736084167
p02267
u146816547
1506141966
Python
Python
py
Runtime Error
0
0
175
n = int(raw_input()) S = map(int, raw_input(),split()) q = int(raw_input()) T = map(int, raw_input().split()) ans = 0 for i in T: if i in S: ans += 1 print ans
s100481415
p02267
u626266743
1510153762
Python
Python3
py
Runtime Error
0
0
110
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) print(len(S & T)
s853223428
p02267
u626266743
1510153795
Python
Python3
py
Runtime Error
0
0
111
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) print(len(S & T))
s518844283
p02267
u626266743
1510153949
Python
Python3
py
Runtime Error
0
0
123
n = int(input()) S = list(map(int, input().split())) q = int(input()) T = list(map(int, input().split())) print(len(S & T))
s034219898
p02267
u424457654
1510670483
Python
Python3
py
Runtime Error
0
0
114
n = int(input()) S = map(int, input(). split()) q = int(input()) T = map(int, input(). split()) print(len(S & T))
s125133120
p02267
u424457654
1510670563
Python
Python3
py
Runtime Error
0
0
126
n = int(input()) S = list(map(int, input(). split())) q = int(input()) T = list(map(int, input(). split())) print(len(S & T))
s877545574
p02267
u530663965
1513777648
Python
Python3
py
Runtime Error
0
0
950
import sys ERROR_INPUT = 'input is invalid' ERROR_INPUT_NOT_UNIQUE = 'input is not unique' def main(): S = get_input1() T = get_input2() count = 0 for t in T: for s in S: if t == s: count += 1 break print(count) def get_input1(): n = int...
s130793925
p02267
u564105430
1525858055
Python
Python3
py
Runtime Error
0
0
199
n=int(input()) s=input().split() q=int(input()) t=input().split() cnt=0 for i in range(q): for j in range(n): if s[i]==t[j]: cnt+=1 break print(cnt)
s199550187
p02267
u843517396
1525879652
Python
Python3
py
Runtime Error
0
0
441
#coding: Shift_JIS import numpy as np def set_array(a,n): str=input() array=str.split() for i in range(n): a[i]=int(array[i]) n=int(input()) S=np.zeros(n) set_array(S,n) q=int(input()) T=np.zeros(q) set_array(T,q) C=0 def linear_search(S,x): np.append(S,x) len=np.size(S) i=0 while(len>i): if S[i]==x: br...
s059951571
p02267
u843517396
1525944247
Python
Python3
py
Runtime Error
0
0
441
#coding: Shift_JIS import numpy as np def set_array(a,n): str=input() array=str.split() for i in range(n): a[i]=int(array[i]) n=int(input()) S=np.zeros(n) set_array(S,n) q=int(input()) T=np.zeros(q) set_array(T,q) C=0 def linear_search(S,x): np.append(S,x) len=np.size(S) i=0 while(len>i): if S[i]==x: br...
s012676796
p02267
u738669341
1526267837
Python
Python3
py
Runtime Error
0
0
131
n=int(input()) a=[] b=[] for i in range(1,n): a[i]=int(input()) x=int(input()) for i in range(1,x): b[i]=int(input())
s290493742
p02267
u687567104
1526308264
Python
Python
py
Runtime Error
0
0
421
#include<iostream> #include<vector> using namespace std; int main(void){ int n, q, num=0; long S[10001], T[501]; std::cin >> n; for(int i=0; i<n; i++){ std::cin >> S[i]; } std::cin >> q; for(int i=0; i<q; i++){ std::cin >> T[i]; } for(int i=0; i<n; i++){ for(int j=0; j<q; j++){ if(S[i] == T[j])...
s550153907
p02267
u573915636
1526388598
Python
Python3
py
Runtime Error
0
0
134
c=0 n=int(input()) s=int(input().split()) nqint(input()) t=int(input().split()) for i in t: for j in s: if i==j: c +=1 print(c)
s208603604
p02267
u573915636
1526388662
Python
Python3
py
Runtime Error
0
0
134
c=0 n=int(input()) s=int(input().split()) nqint(input()) t=int(input().split()) for i in t: for j in s: if i==j: c +=1 print(c)
s062118002
p02267
u826549974
1526393139
Python
Python3
py
Runtime Error
0
0
231
n = int(input()) s = list(map(int,input().split())) q = int(input()) r = list(map(int,input().split())) cou = 0 for i in range(q): for j in range(n): if(s[i] == r[j]): cou += 1 break print(cou)
s798943021
p02267
u687567104
1526403196
Python
Python
py
Runtime Error
0
0
386
#include<iostream> #include<vector> using namespace std; int main(void){ int n, q, num=0; long S[10001], T[501]; std::cin >> n; for(int i=0; i<n; i++){ std::cin >> S[i]; } std::cin >> q; for(int i=0; i<q; i++){ std::cin >> T[i]; } for(int i=0; i<n; i++){ for(int j=0; j<q; j++){ if(S[i] == T[j])...
s861678874
p02267
u733945366
1526404596
Python
Python
py
Runtime Error
0
0
232
S=[] T=[] n=int(input()) s=input().split() for i in range(n): S.append(s[i]) q=int(input()) t=input().split() for j in range(q): T.append(t[j]) cnt=0 for i in range(n): for j in range(q): if S[i]==T[j]: cnt+=1 print(cnt)
s446350835
p02267
u733945366
1526404939
Python
Python
py
Runtime Error
0
0
232
S=[] T=[] n=int(input()) s=input().split() for i in range(n): S.append(s[i]) q=int(input()) t=input().split() for j in range(q): T.append(t[j]) cnt=0 for i in range(n): for j in range(q): if S[i]==T[j]: cnt+=1 print(cnt)
s979936355
p02267
u733945366
1526404969
Python
Python
py
Runtime Error
0
0
229
S=[] T=[] n=int(input()) s=input().split() for i in range(n): S.append(s[i]) q=int(input()) t=input().split() for j in range(q): T.append(t[j]) cnt=0 for i in range(n): for j in range(q): if S[i]==T[j]: cnt+=1 print(cnt)
s729686842
p02267
u728137020
1526417768
Python
Python3
py
Runtime Error
0
0
285
n=int(input()) lista=[0 for i in range(n)] lista=input().split() n2=int(input()) listb=[0 for i in range(n2)] listb=input().split() cnt=0 for i in range(n2): x=0 for j in range(n): if listb[i]==lista[j] and if x==0: x=1 cnt+=1 print(cnt)
s066823861
p02267
u196653484
1526435131
Python
Python3
py
Runtime Error
0
0
1062
#include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #define MAX 10000 int linear_search(int a, int b); void input(int a[]); int main(void) { int count=0; char null; int n,q; int S[MAX]; int T[MAX]; scanf("%d",&n); getchar(); input(S); scanf("%d",&q); ...
s953432261
p02267
u298224238
1529916940
Python
Python3
py
Runtime Error
0
0
282
def linearSearch(key, list): for e in list: if key == e: return 1 return 0 N1 = int(input()) arr1 = [int(n) or n in input().split()] N2 = int(input()) arr2 = [int(n) or n in input().split()] print(sum([linearSearch(key, arr2) for key in arr])
s776329623
p02267
u298224238
1529918171
Python
Python3
py
Runtime Error
0
0
306
def linearSearch(key, list, N): list[N] = key i = 0 while l[i] != key: i += 1 return int(i != N) N1 = int(input()) arr1 = [int(n) for n in input().split() + [0]] N2 = int(input()) arr2 = [int(n) for n in input().split()] print(sum([linearSearch(key, arr1, N1) for key in arr2))
s164911689
p02267
u298224238
1529918187
Python
Python3
py
Runtime Error
0
0
306
def linearSearch(key, list, N): list[N] = key i = 0 while l[i] != key: i += 1 return int(i != N) N1 = int(input()) arr1 = [int(n) for n in input().split()] + [0] N2 = int(input()) arr2 = [int(n) for n in input().split()] print(sum([linearSearch(key, arr1, N1) for key in arr2))
s634851099
p02267
u298224238
1529918203
Python
Python3
py
Runtime Error
0
0
307
def linearSearch(key, list, N): list[N] = key i = 0 while l[i] != key: i += 1 return int(i != N) N1 = int(input()) arr1 = [int(n) for n in input().split()] + [0] N2 = int(input()) arr2 = [int(n) for n in input().split()] print(sum([linearSearch(key, arr1, N1) for key in arr2]))
s210380787
p02267
u298224238
1529991582
Python
Python3
py
Runtime Error
0
0
448
var input = require('fs').readFileSync('/dev/stdin', 'utf8'); var Arr = (input.trim()).split("\n"); var N1 = Number(Arr[0]) var arr1 = Arr[1].split(" ").map(Number); var arr2 = Arr[3].split(" ").map(Number); const linearSearch = (key, arr) => { let i = 0 arr[N1] = key; while (true) { if (arr[i] === key) br...
s005655031
p02268
u153665391
1531022041
Python
Python3
py
Runtime Error
0
0
612
N = int(input()) S = list(map(int, input().split())) Q = int(input()) T = list(map(int, input().split())) def binary_search(target_num, head, tail): idx = int(head+tail) if target_num == S[idx]: return True elif target_num < S[idx]: if head == idx: return False binary_se...
s075843318
p02268
u760378812
1540994429
Python
Python3
py
Runtime Error
0
0
846
#include <iostream> #include <string> #include <cstring> #include <fstream> #include <cmath> #include <iomanip> #include <cstdlib> #include <algorithm> #include <vector> #include <map> #include <deque> #include <map> #include <set> #include <queue> #include <stack> #include <list> #include <unordered_map> using namesp...
s689364991
p02268
u308033440
1545365299
Python
Python3
py
Runtime Error
0
0
994
import copy # 二分探索 def binearSearch(n, S, t): left = 0 right = n while left < right: mid = (left + right) / 2 if A[mid] == key: return mid elif key < A[mid]: right = mid else: left = mid + 1 return NOT_FOUND if __...
s364027343
p02268
u312681524
1545726032
Python
Python
py
Runtime Error
0
0
919
<?php $lengthA = (int) fgets(STDIN); $stdinA = explode(" ",fgets(STDIN)); $lengthKey = (int) fgets(STDIN); $stdinKey = explode(" ",fgets(STDIN)); $count = 0; for($j=0; $j<$lengthKey; ++$j){ $result = BinarySearch($lengthA, $stdinA, $stdinKey[$j]); if($result == 1){ $count++; } } echo $count . PHP_...
s307653989
p02268
u245286435
1423642645
Python
Python
py
Runtime Error
0
0
555
# import sys def binary_search(query, length, array): if length == 1: if query == array[0]: return 1 else: return 0 center = 2 / length if query > array[center]: return binary_search(query, length-(center+1), array[center+1:]) elif query < array[center]: return binary_search(query, center, array[:ce...
s883533998
p02268
u245286435
1423642785
Python
Python
py
Runtime Error
50
4736
555
# import sys def binary_search(query, length, array): if length == 1: if query == array[0]: return 1 else: return 0 center = length / 2 if query > array[center]: return binary_search(query, length-(center+1), array[center+1:]) elif query < array[center]: return binary_search(query, center, array[:ce...
s747834321
p02268
u879226672
1427089514
Python
Python
py
Runtime Error
0
0
453
def binary_search(A,n): # sequence A, item n l = len(A) if l==0: return False elif A[l/2] > n: return binary_search(A[:l/2],n) elif A[l/2] == n: return True elif A[l/2]<n: return binary_search(A[(l/2)+1:],n) n = int(raw_input()) S = set(map(int,raw_input()...
s288822627
p02268
u879226672
1427089678
Python
Python
py
Runtime Error
0
0
458
def binary_search(A,n,l): # sequence A, item n, l len(A) if l==0: return False elif A[l/2] > n: return binary_search(A[:l/2],n) elif A[l/2] == n: return True elif A[l/2]<n: return binary_search(A[(l/2)+1:],n) n = int(raw_input()) S = map(int,raw_input().split(...
s677232796
p02268
u689297737
1432458478
Python
Python
py
Runtime Error
20
4248
959
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_4_B # Binary Search # Result: import sys NO_ANSWER = -1 def binary_sarch(target, ary, start, end): if start == end: if target == ary[start]: return start else: return NO_ANSWER mid = (start + end) / 2 ...
s750461566
p02268
u604774382
1433368013
Python
Python3
py
Runtime Error
0
0
345
n = int( input( ) ) s = [ int( val ) for val in input( ).split( " " ) ] q = int( input( ) ) t = [ int( val ) for val in input( ).split( " " ) ] cnt = 0 cnt = 0 for ti in t: low = 0 high = n - 1 while low <= high: m = ( low+high )/2 if ti < s[m]: high = m - 1 elif s[m] < ti: low = m + 1 else: cnt +=...
s619049276
p02268
u271261336
1443524480
Python
Python
py
Runtime Error
0
0
106
n = input() S = map(int,raw_input().split()) m = input() T = map(int,raw_input().split()) print len(T & S)
s551240260
p02268
u271261336
1443526288
Python
Python
py
Runtime Error
0
0
386
n = input() S = set([int(s) for s in raw_input().split()]) m = input() T = set([int(s) for s in raw_input().split()]) r=[] def binarySearch(a=[],p=0): ll=0 ul=len(a) while(True): if ll>ul: return -1 ms=(int(ll)+int(ul))/2 if a[i]==p: r.append(p) elif a[i]>p: ul=i-1 else: ll=i+1 if __n...
s600635934
p02268
u271261336
1443530619
Python
Python
py
Runtime Error
0
0
104
n = input() S = map(int,raw_input().split()) m = input() T = map(int,raw_input().split()) print len(S&T)
s767281258
p02268
u271261336
1443530640
Python
Python
py
Runtime Error
0
0
108
n = input() S = set(int(),raw_input().split()) m = input() T = set(int(),raw_input().split()) print len(S&T)
s302220319
p02268
u488601719
1448248404
Python
Python3
py
Runtime Error
0
0
440
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) def binary_search(A, key): left = 0 right = n while left < right: mid = (left + right)/2 if A[mid] == key: return True elif key < A[mid]: right = mid else: ...
s151077858
p02268
u963402991
1448946291
Python
Python3
py
Runtime Error
0
0
459
# -*- coding:utf-8 -*- def binarySearch(A, key): left, right = 0, n while left < right: mid = (left + right) / 2 if A[mid] == key: return True elif key < A[mid]: right = mid else: left = mid += 1 return False n = int(input()) S = [int(i)...
s792465042
p02268
u317901693
1450680647
Python
Python3
py
Runtime Error
0
0
375
from collections import deque iterator = [["NS", "S"], ["NT", "T"]] var = {} for i, j in iterator: var[i] = int(input()) var[j] = [int(k) for k in input().split()] var["S"] = sorted(var["S"]) var["T"] = sorted(var["T"]) dq = deque(var["S"]) res = 0 for T in var["T"]: if T in dq: res += 1 ...
s569527841
p02268
u885889402
1452047694
Python
Python3
py
Runtime Error
0
0
444
def gost(lis,ky): lens=len(lis) if lens <= 5: if ky in lis: return True else: return False if ky <= lis[lens//2]: return gost(lis[:lens],ky) else: return gost(lis[lens:],ky) n = int(input()) a = input() s=list(map(int,a.split()...
s522619546
p02268
u885889402
1452048156
Python
Python3
py
Runtime Error
0
0
448
def gost(lis,ky): lens=len(lis) if lens <= 5: if ky in lis: return True else: return False if ky <= lis[lens//2]: return gost(lis[:lens/2],ky) else: return gost(lis[lens/2:],ky) n = int(input()) a = input() s=list(map(int,a.spl...
s171058810
p02268
u885889402
1452076246
Python
Python3
py
Runtime Error
0
0
508
def gost(lis,ky): lens=len(lis) if lens <= 5: print("key = "+str(ky) print(lis) if ky in lis: return True else: return False if ky <= lis[(lens//2)-1]: return gost(lis[:(lens//2)],ky) else: return gost(lis[(lens//2):]...
s242134285
p02268
u000228958
1452086477
Python
Python3
py
Runtime Error
0
0
251
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for i in range(q): j = 0 S[n] = T[i] while S[j] != S[n]: j = j + 1 if j != n: cnt = cnt + 1 print cnt
s087438164
p02268
u000228958
1452086626
Python
Python3
py
Runtime Error
0
0
378
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for i in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right...
s277133359
p02268
u000228958
1452086652
Python
Python
py
Runtime Error
0
0
378
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for i in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right...
s337988011
p02268
u885889402
1452086675
Python
Python3
py
Runtime Error
0
0
519
def gost(lis,ky,r,l): lens=l-r+1 if lens <= 5: print("key = "+str(ky)) print(lis) if ky in lis[r:l]: return True else: return False if ky <= lis[(lens//2)-1]: return gost(lis,ky,r,r+(lens//2)) else: return gost(lis,ky...
s901272954
p02268
u885889402
1452086713
Python
Python3
py
Runtime Error
0
0
468
def gost(lis,ky,r,l): lens=l-r+1 if lens <= 5: if ky in lis[r:l]: return True else: return False if ky <= lis[(lens//2)-1]: return gost(lis,ky,r,r+(lens//2)) else: return gost(lis,ky,l-(lens//2),l) n = int(input()) a = input() ...
s995117361
p02268
u885889402
1452086791
Python
Python3
py
Runtime Error
0
0
479
def gost(lis,ky,r,l): lens=l-r+1 if lens <= 5: if ky in lis[r:l]: return True else: return False if ky <= lis[(lens//2)-1]: return gost(lis,ky,r,r+(lens//2)) else: return gost(lis,ky,l-(lens//2),l) n = int(input()) a = input() ...
s030441574
p02268
u000228958
1452087052
Python
Python3
py
Runtime Error
0
0
367
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for j in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right...
s689140391
p02268
u000228958
1452087070
Python
Python
py
Runtime Error
0
0
367
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for j in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right...
s571702111
p02268
u000228958
1452087339
Python
Python
py
Runtime Error
0
0
378
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for j in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right...
s784912688
p02268
u000228958
1452087355
Python
Python3
py
Runtime Error
0
0
378
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) S.append(0) cnt = 0 for j in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right...
s256792336
p02268
u000228958
1452087412
Python
Python
py
Runtime Error
0
0
366
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) cnt = 0 for j in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right = mid ...
s271913924
p02268
u000228958
1452087433
Python
Python3
py
Runtime Error
0
0
366
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) cnt = 0 for j in range(q): left = 0 right = n while left < right: mid = (left + right) / 2 if S[mid] == T[j]: cnt = cnt + 1 else if T[j] < S[mid]: right = mid ...
s989289787
p02268
u797673668
1452434685
Python
Python3
py
Runtime Error
30
7684
424
n, s, q, t = int(input()), list(set(map(int, input().split()))), input(), set(map(int, input().split())) # print(sum(i in s for i in t)) def binary_search(i): global n, s l, r = 0, n while l < r: m = (l + r) // 2 sm = s[m] if sm == i: return 1 elif i < sm: ...
s720800251
p02268
u567281053
1456679245
Python
Python
py
Runtime Error
40
6900
514
def binarySearch(key, lst): while len(lst) != 1: i = len(lst) / 2 if lst[i] > key: lst = lst[:i] elif lst[i] < key: lst = lst[i + 1:] else: return True if lst[0] == key: return True else: return False if __name__ == "__mai...
s250647200
p02268
u569960318
1465285649
Python
Python3
py
Runtime Error
0
0
457
ef binarySearch(S,t): if len(S) == 1: return S[0] == t m = len(S)//2 if S[m] == t: return True if S[m] > t: return binarySearch(S[:m],t) if len(S) > 2: return binarySearch(S[m+1:],t) return False if __name__=='__main__': n=int(input()) S=list(map(int,inpu...
s516723142
p02268
u669873554
1468854090
Python
Python3
py
Runtime Error
0
0
546
count_n = int(input()) N = [] n = input() N = n.split() N = list(map(lambda x: int(x), N)).sort() count_p = int(input()) P = [] p = input() P = p.split() P = list(map(lambda x: int(x), P)).sort() def b(i, l): left = 0 right = len(l) while left < right: mid = int((left + right) / 2) if l[...
s808858773
p02268
u813534019
1476845315
Python
Python
py
Runtime Error
10
6288
505
input() slist = raw_input().split() input() tlist = raw_input().split() def func(v, low, high): mid = (low + high)/2 if mid >= len(slist): return False if v > slist[mid]: if low == high: return False return func(v, mid+1, high) elif v == slist[mid]: ...
s640415589
p02268
u159356473
1477296573
Python
Python3
py
Runtime Error
0
0
146
30 0 0 0 0 2 3 3 3 4 5 6 7 8 8 8 9 9 9 10 11 11 12 12 12 12 13 13 7000000 500000000 1000000000 16 2 0 5 11 3 16 4 6 1 10 7 14 15 7000000 9 5555555
s654947206
p02268
u022407960
1478017048
Python
Python
py
Runtime Error
0
0
783
# encoding: utf-8 class Solution: @staticmethod def binary_search(): array_length_1 = int(input()) array_1 = [int(x) for x in input().split()] array_length_2 = int(input()) array_2 = [int(x) for x in input().split()] # print(len(set(array_1).intersection(set(array_2)))...
s916288244
p02268
u811733736
1480580653
Python
Python3
py
Runtime Error
0
0
736
from bisect import bisect_left @lru_cache(maxsize=None) def index(a, x): ''' Locate the leftmost value exactly equal to x http: // docs.python.jp / 3.5 / library / bisect.html ''' i = bisect_left(a, x) if i != len(a) and a[i] == x: return i raise ValueError if __name__ == '__main__': ...
s978550100
p02268
u960191521
1480975288
Python
Python3
py
Runtime Error
0
0
1052
# coding: utf-8 import numpy as np n = int(input()) s = np.array(list(map(int, input().rstrip().split()))) q = int(input()) t = np.array(list(map(int, input().rstrip().split()))) # print("s:",s) count = 0 def binary_search(array, value): ''' array must be sorted''' # print("value:{}".format(value)) size = ...
s070393428
p02268
u416495268
1485486479
Python
Python3
py
Runtime Error
0
0
411
n = int(input()) S = list(map(int, input().split())) q = int(input()) T = list(map(int, input().split())) def binary_search(A, key): left = 0 right = n while left < right: mid = int((left + right)/2) if A[mid] == key: return True elif key < A[mid]: right = mid else: left = mid +...
s224121517
p02268
u416495268
1485486538
Python
Python3
py
Runtime Error
0
0
405
n = int(input()) S = list(map(int, input().split())) q = int(input()) T = list(map(int, input().split())) def binary_search(A, key): left = 0 right = n while left < right: mid = int((left + right)/2) if A[mid] == key: return True elif key < A[mid]: right = mid else: left = mid +...
s606176775
p02268
u416495268
1485486626
Python
Python3
py
Runtime Error
0
0
409
n = int(input()) S = [int(s) for s in input().split()] q = int(input()) T = [int(t) for t in input().split()] def binary_search(A, key): left = 0 right = n while left < right: mid = int((left + right)/2) if A[mid] == key: return True elif key < A[mid]: right = mid else: left = m...
s669716980
p02268
u854976463
1487811943
Python
Python
py
Runtime Error
0
0
1353
def binsearch(order, key): n = len(order) / 2 if order[n] == key: return True, n elif order[n] > key: ...
s036986650
p02268
u130834228
1490516783
Python
Python3
py
Runtime Error
0
0
79
n = input() S = input().split() q = input() T = input().split() print(len(S&T)
s939300886
p02268
u130834228
1490516802
Python
Python3
py
Runtime Error
0
0
80
n = input() S = input().split() q = input() T = input().split() print(len(S&T))
s541602365
p02268
u130834228
1490516827
Python
Python3
py
Runtime Error
0
0
80
n = input() S = input().split() q = input() T = input().split() print(len(S&T))
s093575465
p02268
u130834228
1490518325
Python
Python3
py
Runtime Error
0
0
402
n = input() S = set(input().split()) q = input() T = set(input().split()) #print(len(S&T)) #set:??????????????????????????? cnt = 0 for i in range(T): left = 0 right = n-1 while left < right: mid = (left+right) // 2 if S[mid] == i: cnt += 1 break elif S[mid...
s906106472
p02268
u130834228
1490518351
Python
Python3
py
Runtime Error
0
0
396
n = input() S = (input().split()) q = input() T = (input().split()) #print(len(S&T)) #set:??????????????????????????? cnt = 0 for i in range(T): left = 0 right = n-1 while left < right: mid = (left+right) // 2 if S[mid] == i: cnt += 1 break elif S[mid] < i:...
s981066531
p02268
u939814144
1495213103
Python
Python3
py
Runtime Error
0
0
155
def binary_search(): input() s = set(input().split()) input() t = set(input().split()) print(len(s & t)) if __name__ == '__main__': linear_search()
s723916905
p02268
u091533407
1498466613
Python
Python3
py
Runtime Error
50
8432
509
def binary_search(S, a): leng = len(S) mid = leng // 2 if S[mid] == a: return True elif leng < 2: return False elif S[mid] < a: return binary_search(S[mid+1:], a) else: return binary_search(S[:mid], a) if __name__=="__main__": n = int(input()) S =...
s798364831
p02268
u591467586
1499222832
Python
Python3
py
Runtime Error
0
0
442
n1 = int(input()) s = (input()).split() n2 = int(input()) t = (input()).split() m = [] for i in range(0, n2): left = 0 right = n1 key = int(t[i]) while left < right: mid = int((left + right)/2) if s[mid] == key: m.append(key) break ...
s887120723
p02268
u591467586
1499222892
Python
Python3
py
Runtime Error
0
0
442
n1 = int(input()) s = (input()).split() n2 = int(input()) t = (input()).split() m = [] for i in range(0, n2): left = 0 right = n1 key = int(t[i]) while left < right: mid = int((left + right)/2) if s[mid] == key: m.append(key) break ...
s016424852
p02268
u591467586
1499223075
Python
Python3
py
Runtime Error
0
0
452
n1 = int(input()) s = (input()).split() n2 = int(input()) t = (input()).split() m = [] for i in range(0, n2): left = 0 right = n1 key = int(t[i]) while left < right: mid = int((left + right)/2) if int(s[mid]) == key: m.append(key) brea...
s258575548
p02268
u264972437
1500445744
Python
Python3
py
Runtime Error
0
0
339
def binarySeach(t): left,right = 0,n while right > left: mid = (left+right) // 2 if S[mid] == t: return True elif S[mid] > t: mid = right else: mid = left return False n = int(input()) S = [int(s) for s in input().split()] q = int(input()) T = [int(s) for s in input().split()] print(sum([binarySer...
s957891311
p02268
u264972437
1500446018
Python
Python3
py
Runtime Error
0
0
339
def binarySeach(t): left,right = 0,n while right > left: mid = (left+right) // 2 if S[mid] == t: return True elif S[mid] > t: mid = right else: mid = left return False n = int(input()) S = [int(s) for s in input().split()] q = int(input()) T = [int(s) for s in input().split()] print(sum([binarySer...
s282333815
p02268
u491916705
1502160337
Python
Python
py
Runtime Error
10
6468
771
n = int(raw_input()) if n > 1: s = map(int, raw_input().split()) else: s = int(raw_input()) q = int(raw_input()) if q > 1: t = map(int, raw_input().split()) else: t = [int(raw_input())] count = 0 for i in range(q): tmp = int(n/2) gap = 1./2 flag = 0 if t[i] < s[0] or t[i] > s[n-1]:...
s012018280
p02268
u659034691
1503001032
Python
Python3
py
Runtime Error
20
7720
513
# your code goes here #binary n=int(input()) S=[int(i) for i in input().split()] q=int(input()) T=[int(i) for i in input().split()] C=0 for i in range(q): j=n//2 b=n//2+1 while T[i]!=S[j] and b>1: if b%2==1: b+=1 b//=2 if T[i]>S[j]: j+=b elif T[i]<S[j]...
s979563654
p02268
u659034691
1503001376
Python
Python3
py
Runtime Error
20
7748
511
# your code goes here #binary n=int(input()) S=[int(i) for i in input().split()] q=int(input()) T=[int(i) for i in input().split()] C=0 for i in range(q): j=n//2 b=n//2 while T[i]!=S[j] and b>1: if b%2==1: b+=1 b//=2 if T[i]>S[j]: j+=b elif T[i]<S[j]: ...
s646734042
p02268
u735204496
1505201202
Python
Python
py
Runtime Error
0
0
662
import sys def binary_search(array, num, left, right): if right < left: return False center = (right + left) / 2 if array[center] == num: return True elif array[center] < num: return binary_search(array, num, center + 1, right) elif array[center] > num: return binary...
s241848548
p02268
u846136461
1510304316
Python
Python
py
Runtime Error
40
6896
530
n = raw_input() S = map(int, raw_input().split()) q = raw_input() T = map(int, raw_input().split()) def BinarySearch(list, num): #print list l = len(list) if l == 1 and list[0] != num: #print("*0") return 0 else: if list[l/2] == num: #print("*1") return 1 elif list[l/2] < num: #print("*2") retu...
s101533466
p02268
u262566745
1510546445
Python
Python3
py
Runtime Error
0
0
453
n = int(input()) S = map(int, input().split(" ")) q = int(input()) T = map(int, input().split(" ")) def binary_search(target, key): left = 0 right = len(S) while(left < right): mid = (left + right) // 2 if S[mid] == key: return True elif S[mid] < key: lef...
s082240058
p02268
u626266743
1510660477
Python
Python3
py
Runtime Error
0
0
122
n = int(input()) S = list(map(int, input().split())) q = int(input()) T = list(map(int, input().split())) print(len(S&T))
s484335373
p02268
u626266743
1510660516
Python
Python3
py
Runtime Error
0
0
110
n = int(input()) S = set(int, input().split()) q = int(input()) T = set(int, input().split()) print(len(S&T))
s547683412
p02268
u845643816
1510710087
Python
Python3
py
Runtime Error
0
0
383
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) count = 0 for key in T: left = 0 right = n while left < right mid = (right - left) // 2 if S[mid] == key: count = count + 1 break else if key < S[mid] r...
s003251588
p02268
u845643816
1510710119
Python
Python3
py
Runtime Error
0
0
385
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) count = 0 for key in T: left = 0 right = n while left < right mid = (right - left) // 2 if S[mid] == key: count = count + 1 break else if key < S[mid]: ...
s248978974
p02268
u845643816
1510710131
Python
Python3
py
Runtime Error
0
0
386
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) count = 0 for key in T: left = 0 right = n while left < right: mid = (right - left) // 2 if S[mid] == key: count = count + 1 break else if key < S[mid]: ...
s855367625
p02268
u845643816
1510710181
Python
Python3
py
Runtime Error
0
0
383
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) count = 0 for key in T: left = 0 right = n while left < right: mid = (right - left) // 2 if S[mid] == key: count = count + 1 break elif key < S[mid]: ri...
s071374058
p02268
u845643816
1510710286
Python
Python3
py
Runtime Error
0
0
381
n = int(input()) S = map(int, input().split()) q = int(input()) T = map(int, input().split()) count = 0 for key in T: left = 0 right = n while left < right: mid = (right - left) // 2 if S[mid] == key: count = count + 1 break if key < S[mid]: righ...
s439255544
p02268
u845643816
1510710390
Python
Python3
py
Runtime Error
0
0
288
count = 0 for key in T: left = 0 right = n while left < right: mid = (right - left) // 2 if S[mid] == key: count = count + 1 break if key < S[mid]: right = mid else: left = mid + 1 print(count)
s990625665
p02268
u062548499
1513326805
Python
Python3
py
Runtime Error
0
0
604
n = input() S = map(int, raw_input().split()) q = input() T = map(int, raw_input().split()) def binary_search(lindex, rindex, key): while lindex <= rindex: if lindex == rindex: if S[lindex] == key: return True break midindex = (lindex + rindex) / 2 if...
s399324078
p02268
u530663965
1513835202
Python
Python3
py
Runtime Error
0
0
1287
import sys ERROR_INPUT = 'input is invalid' ERROR_INPUT_NOT_UNIQUE = 'input is not unique' def main(): S = get_input1() T = get_input2() count = 0 for t in T: if binary_search(S, t, 0, len(S), len(S) // 2): print(t) count += 1 print(count) def binary_search(li,...