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
s158305689
p03558
u158225062
1509850407
Python
Python (3.4.3)
py
Runtime Error
18
3060
264
# coding: utf-8 N = int(input()) array = [] X = int(100000/N) for i in range(X): Y = str(N*(i+1)) a_list = list(map(int,Y)) ddd = sum(a_list) if ddd < array[1]: array.pop(0) array.append(ddd) print(int(array[0]))
s934495419
p03558
u158225062
1509849420
Python
Python (3.4.3)
py
Runtime Error
18
3060
255
# coding: utf-8 N = int(input()) array = [] X = int(100000/N) for i in range(X): Y = N*(i+1) STR = str(Y) a_list = list(map(float,STR)) ddd = sum(a_list) array.append(sum(ddd)) sum_list = min(array) print(int(sum_list))
s335194463
p03558
u158225062
1509849361
Python
Python (3.4.3)
py
Runtime Error
17
3064
253
# coding: utf-8 N = int(input()) array = [] X = int(100000/N) for i in range(X): Y = N*(i+1) STR = str(Y) a_list = list(map(float,STR)) ddd = sum(a_list) array.append(sum(ddd) sum_list = min(array) print(int(sum_list)
s730791393
p03558
u158225062
1509849238
Python
Python (3.4.3)
py
Runtime Error
17
3064
237
# coding: utf-8 N = int(input()) array = [] X = int(100000/N) for i in range(X): Y = N*(i+1) STR = str(Y) a_list = list(map(float,STR)) array.append(sum(a_list)) sum_list = min(a_list) print(int(sum_list)
s330509419
p03558
u655821296
1509849094
Python
Python (3.4.3)
py
Runtime Error
17
3064
316
N = int((input())) A = [int(i) for i in input().split()] B = [int(i) for i in input().split()] C = [int(i) for i in input().split()] can_make = 0 for upp in range(N): for midd in range(N): for loww in range(N): if A[upp] < B[midd] < C[loww]: can_make += 1 print(can_make)
s897186146
p03558
u906129425
1509844924
Python
Python (3.4.3)
py
Runtime Error
17
2940
466
def s(n): return sum(int(c) for c in str(n)) def main(): n = int(input()) powers = [10] for _ in range(10000): powers.append(powers[-1] * 10) digsum = s(n) for power in powers: if power < n: continue ...
s286056977
p03559
u085717502
1600614728
Python
Python (3.8.2)
py
Runtime Error
134
29224
356
#!/usr/bin/env python # coding: utf-8 # In[4]: N = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) # In[6]: ans = 0 for b in B: while i<N and A[i]<b: i+=1 while j<N and C[j]<=b: j+=1 ans +...
s466590400
p03559
u810787773
1599619458
Python
Python (3.8.2)
py
Runtime Error
2206
30408
1464
def binery_search(left,right,keynum,list): mid = 0 while True: #print(left,right,mid,cnt) mid = int( (left+right)/2 ) if keynum == list[mid]: while True: if list[mid] == list[mid+1]: mid +=1 i...
s889005304
p03559
u810787773
1599619201
Python
Python (3.8.2)
py
Runtime Error
2206
30308
1427
def binery_search(left,right,keynum,list): mid = 0 while True: #print(left,right,mid,cnt) mid = int( (left+right)/2 ) if keynum == list[mid]: while True: if list[mid] == list[mid+1]: mid +=1 i...
s165949220
p03559
u810787773
1599619180
Python
Python (3.8.2)
py
Runtime Error
2360
152932
1426
def binery_search(left,right,keynum,list): mid = 0 while True: #print(left,right,mid,cnt) mid = int( (left+right)/2 ) if keynum == list[mid]: while True: if list[mid] == list[mid+1]: mid +=1 i...
s599094502
p03559
u044220565
1599509244
Python
Python (3.8.2)
py
Runtime Error
238
31452
1104
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read #from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) #import math #from itertools import product, accumulate, combinations, product import bisect ...
s677549878
p03559
u044220565
1599509232
Python
Python (3.8.2)
py
Runtime Error
247
31648
1104
# coding: utf-8 import sys #from operator import itemgetter sysread = sys.stdin.buffer.readline read = sys.stdin.buffer.read #from heapq import heappop, heappush from collections import defaultdict sys.setrecursionlimit(10**7) #import math #from itertools import product, accumulate, combinations, product import bisect ...
s110393502
p03559
u370721525
1599439178
Python
Python (3.8.2)
py
Runtime Error
563
29548
433
import bisect from collections import deque N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() d = deque([]) for i in range(N): n = bisect.bisect_right(C, B[N-1-i]) if len(d) == 0: d.appendleft(N-n) else: ...
s330359103
p03559
u505830998
1595354262
Python
PyPy3 (7.3.0)
py
Runtime Error
183
106380
1334
import sys input_methods=['clipboard','file','key'] using_method=0 input_method=input_methods[using_method] tin=lambda : map(int, input().split()) lin=lambda : list(tin()) mod=1000000007 #+++++ def main(): n = int(input()) #b , c = tin() #s = input() if n == 3: return 1/0 al = lin() bl = lin() cl = lin() ...
s151635226
p03559
u423966555
1595108217
Python
Python (3.8.2)
py
Runtime Error
2206
29364
898
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A.sort() B.sort() C.sort() tmp_b = 0 tmp_c = 0 max_b = B[-1] max_c = C[-1] ans = 0 for i in range(N): flg = False tmp = A[i] if tmp >= max_b: break while True: ...
s900745536
p03559
u024340351
1594380267
Python
Python (3.8.2)
py
Runtime Error
136
29288
289
N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) C = list(map(int, input().split())) A = sorted(A) B = sorted(B) C = sorted(C) # for this we will use binary search. import bisect as bis for i in range (0, N): BSC[i] = N-bis.bisect_right(C, B[i])
s940854189
p03559
u569322757
1589683198
Python
Python (3.4.3)
py
Runtime Error
261
23328
287
import bisect I = lambda: list(map(int, input().split())) N = I() A = I() B = I() C = I() A.sort() B.sort() C.sort() summ = 0 for ai in A: r = bisect.bisect_right(B, ai) for bi in B[r:]: rr = bisect.bisect_right(C, bi) summ += (N - r) * (N - rr) print(summ)
s913625100
p03559
u707124227
1588623563
Python
PyPy3 (2.4.0)
py
Runtime Error
388
118372
624
def main(n,a,b,c): import bisect ans=0 todo=[[ai] for ai in a] while len(todo)>0: d=todo.pop() if len(d)==1: l=bisect.bisect_right(b,d[-1]) for li in b[l:]: e=d.copy() e.append(li) todo.append(e) elif len(d)==2: l=bisect.bisect_right(c,d[-1]) for li in...
s979771043
p03559
u707124227
1588622924
Python
PyPy3 (2.4.0)
py
Runtime Error
396
118500
620
def main(n,a,b,c): import bisect ans=0 todo=[[ai] for ai in a] while len(todo)>0: d=todo.pop() if len(d)==1: l=bisect.bisect_right(b,d[-1]) for li in b[l:]: e=d.copy() e.append(li) todo.append(e) if len(d)==2: l=bisect.bisect_right(c,d[-1]) for li in c...
s097741449
p03559
u707124227
1588621331
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
138840
810
def main(n,a,b,c): import bisect ab=[] #ab[i]:上部にi個目を選んだ時、中部に選べるもののうち最小のインデックス。選べないならnになる ab.append(bisect.bisect_right(b,a[0])) bc=[] bc.append(bisect.bisect_right(c,b[0])) for i in range(1,n): if a[i]<b[ab[i-1]]: ab.append(ab[i-1]) else: ab.append(bisect.bisect_right(b[ab[i-1]:],a[i])+...
s818290083
p03559
u707124227
1588620528
Python
Python (3.4.3)
py
Runtime Error
2105
46340
729
import bisect n=int(input()) a=sorted(list(map(int,input().split()))) b=sorted(list(map(int,input().split()))) c=sorted(list(map(int,input().split()))) ab={} #ab[i]:上部にi個目を選んだ時、中部に選べるもののうち最小のインデックス。選べないならnになる l=bisect.bisect_right(b,a[0]) ab[0]=l for i in range(1,n): if a[i]<b[ab[i-1]]: ab[i]=ab[i-1] else: ...
s631845417
p03559
u707124227
1588620384
Python
Python (3.4.3)
py
Runtime Error
2106
46340
719
import bisect n=int(input()) a=sorted(list(map(int,input().split()))) b=sorted(list(map(int,input().split()))) c=sorted(list(map(int,input().split()))) ab={} #ab[i]:上部にi個目を選んだ時、中部に選べるもののうち最小のインデックス。選べないならnになる l=bisect.bisect_right(b,a[0]) ab[0]=l for i in range(1,n): if a[i]<b[ab[i-1]]: ab[i]=ab[i-1] else: ...
s730563914
p03559
u690037900
1587435844
Python
PyPy3 (2.4.0)
py
Runtime Error
332
92516
321
import sys import bisect input = sys.stdin.readline num=0 n=int(input()) top=list(map(int,input().split())) mid=list(map(int,input().split())) und=list(map(int,input().split())) top.sort() mid.sort() und.sort() for i in mid: a=bisect.bisect_left(top,i) c=len(c)-bisect.bisect_right(und,i) num+=a*c print(num)...
s742270600
p03559
u690037900
1587435798
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38384
322
import sys import bisect input = sys.stdin.readline() num=0 n=int(input()) top=list(map(int,input().split())) mid=list(map(int,input().split())) und=list(map(int,input().split())) top.sort() mid.sort() und.sort() for i in mid: a=bisect.bisect_left(top,i) c=len(c)-bisect.bisect_right(und,i) num+=a*c print(nu...
s518724293
p03559
u767664985
1587432193
Python
Python (3.4.3)
py
Runtime Error
335
23092
310
from bisect import bisect_left N = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) ans = 0 for ai in range(N): bi = bisect_left(B, A[ai]) ci = bisect_left(C, B[bi]) ans += (N-bi)*(N-ci) print(ans)
s784475681
p03559
u345966487
1587264537
Python
Python (3.4.3)
py
Runtime Error
360
22720
199
from bisect import* r=lambda:sorted(map(int,input().split())) N=r()[0] A,B,C,w,s=r(),r(),r(),[0]*N,0 for i in range(N-1,-1,-1):s=w[i]=s+N-bisect(C,B[i]) print(sum(w[bisect(B,A[i])]for i in range(N)))
s895617322
p03559
u244416763
1585874770
Python
Python (3.4.3)
py
Runtime Error
2104
24052
1061
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) a.sort() b.sort() ans = 0 for i in range(n): B_HIGH = n-1 B_LOW = 0 B_NOW = 0 while(1 < (B_HIGH - B_LOW)): B_NOW = (B_HIGH + B_LOW)//2 if c[i] < b[B_NOW]: ...
s762239974
p03559
u244416763
1585874008
Python
Python (3.4.3)
py
Runtime Error
2104
23136
1174
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) a.sort() b.sort() c.sort() ans = 0 """ print(a) print(b) print(c) """ for i in range(n): B_HIGH = n-1 B_LOW = 0 B_NOW = 0 while(1 < (B_HIGH - B_LOW)): B_NOW = (B_HIGH + B_LOW...
s277166888
p03559
u995053308
1584196535
Python
Python (3.4.3)
py
Runtime Error
26
3316
1124
# -*- coding: cp932 -*- import sys import os import re import datetime import bisect def Test(value): a = [1,3,5] #x = 4 insert_index = bisect.bisect_left(a, value) print("insert_index = ", insert_index) if False: while(True): Test(int(input('? '))); sys.exit() N = int...
s539398554
p03559
u995053308
1584195893
Python
Python (3.4.3)
py
Runtime Error
24
3444
976
# -*- coding: cp932 -*- import sys import os import re import datetime import bisect def Test(value): a = [1,3,5] #x = 4 insert_index = bisect.bisect_left(a, value) print("insert_index = ", insert_index) ####### main ####### if False: while(True): Test(int(input('? '))); ...
s132191556
p03559
u426649993
1583954875
Python
Python (3.4.3)
py
Runtime Error
344
23924
610
from bisect import bisect_right if __name__ == "__main__": n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = list(map(int, input().split())) a = sorted(a) b = sorted(b) c = sorted(c) ans = 0 # まずあるbを選んだ時のcの組み合わせの数のリストを作る。 clist = [0] ...
s264979369
p03559
u871352270
1583874825
Python
Python (3.4.3)
py
Runtime Error
201
23156
681
N = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(int, input().split()))) ad = defaultdict(lambda: -1) i, j = 0, 0 while i < N and j < N: if A[i] < B[j]: ad[i] = j i += 1 else: j += 1 bd = defaultdict(lambda: -1) ...
s610798228
p03559
u922487073
1583694640
Python
Python (3.4.3)
py
Runtime Error
421
23156
645
import bisect N = int(input()) As = sorted(list(map(int, input().split()))) Bs = sorted(list(map(int, input().split()))) Cs = sorted(list(map(int, input().split()))) # BとCのセットだけ見てありえるパターンを出す # B_Csは注目要素より右側の和 B_Cs = [0] * N prev = N - bisect.bisect_left(Cs, Bs[-1]) B_Cs[-1] = prev for i, b in enumerate(reversed(Bs))...
s210732941
p03559
u922487073
1583693475
Python
Python (3.4.3)
py
Runtime Error
2105
23092
501
import bisect N = int(input()) As = sorted(list(map(int, input().split()))) Bs = sorted(list(map(int, input().split()))) Cs = sorted(list(map(int, input().split()))) # BとCのセットだけ見てありえるパターンを出す B_Cs = [0] * N for i, b in enumerate(Bs): index = bisect.bisect_left(Cs, b+1) B_Cs[i] = (N - index) cumsum_BC =[sum(B_...
s125298191
p03559
u189023301
1583556936
Python
Python (3.4.3)
py
Runtime Error
19
2940
451
import bisect import sys readline = sys.stdin.buffer.readline def main(): n = int(readline()) a = list(map(int,readline().rsplit())) b = list(map(int,readline().rsplit())) c = list(map(int,readline().rsplit())) as = sorted(a) cs = sorted(C) ans = 0 for i in b: d = bisect.bisect...
s580809869
p03559
u993435350
1580565773
Python
Python (3.4.3)
py
Runtime Error
17
2940
617
#include <bits/stdc++.h> using namespace std; int main(){ int N; cin >> N; int con; con = 0; vector<vector<int>> parts(3, vector<int>(N)); for(int i = 0;i < 3; i++){ for(int j = 0;j < N; j++){ cin >> parts[i][j]; } } for (int i = 0;i < N; i ++){ for...
s351237763
p03559
u993435350
1580564949
Python
Python (3.4.3)
py
Runtime Error
2105
24904
489
N = int(input()) parts = [[] for i in range(3)] bigger = [[0] * N for i in range(2)] m = 0 for i in range(3): t = list(map(int,input().split())) t = [i for i in t if i >= m] parts[i] = t m = min(t) under =parts[2] middle = parts[1] upper = parts[0] con = 0 for i in range(len(under)): p = under[i] for j...
s939726817
p03559
u905582793
1576947004
Python
Python (3.4.3)
py
Runtime Error
17
3064
273
import bisect n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() ans=0 for i in range(n): x=b[i] y=bisect.bisect_left(a,x) z=bisect.bisect_right(c,x) ans+=(n-z)*y print(ans)
s805387085
p03559
u905582793
1576945576
Python
Python (3.4.3)
py
Runtime Error
192
23360
281
import bisect n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() ans=0 for i in range(n): x=a[i] y=bisect.bisect_right(x) if y<n: z=bisect.bisect_right(b[y]) ans+=n-z print(ans)
s994489471
p03559
u905582793
1576945533
Python
Python (3.4.3)
py
Runtime Error
195
23360
267
import bisect n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() ans=0 for i in range(n): x=a[i] y=bisect.bisect_right(x) z=bisect.bisect_right(b[y]) ans+=n-z print(ans)
s756059863
p03559
u296518383
1568614127
Python
Python (3.4.3)
py
Runtime Error
387
23328
465
N=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() bc=[0]*N ii=0 for i in range(N): while c[ii]<=b[i] and ii<N: ii+=1 if ii==N: break bc[i]=N-ii #print(bc) for i in range(N-2,-1,-1): bc[i]+=bc[i+1] #print(bc) ...
s549239453
p03559
u410118019
1564962470
Python
Python (3.4.3)
py
Runtime Error
392
25668
384
import bisect from itertools import accumulate n = int(input()) a = sorted(map(int,input().split())) b = sorted(map(int,input().split())) c = sorted(map(int,input().split())) aa = [0] * n bb = [0] * n for i in range(n): bb[i] = n - bisect.bisect_right(c,b[i]) bb.reverse() bbb = tuple(accumulate(bb)) for i in range(n)...
s278391456
p03559
u410118019
1564962455
Python
Python (3.4.3)
py
Runtime Error
383
31456
401
import bisect from itertools import accumulate n = int(input()) a = sorted(map(int,input().split())) b = sorted(map(int,input().split())) c = sorted(map(int,input().split())) aa = [0] * n bb = [0] * n for i in range(n): bb[i] = n - bisect.bisect_right(c,b[i]) bb.reverse() bbb = tuple(accumulate(bb)) for i in range(n)...
s685415900
p03559
u333139319
1561049284
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
139144
309
n = int(input()) a = [int(i) for i in input().split()] b = [int(i) for i in input().split()] c = [int(i) for i in input().split()] d = 0 a.sort() b.sort() c.sort() ls = b for i in range(n): ls = [bs for bs in ls if bs > a[i]] for j in range(len(ls)): d += len([cs for cs in c if cs > ls[i]]) print(d)
s380410823
p03559
u239316561
1560047355
Python
Python (3.4.3)
py
Runtime Error
1413
23296
691
n = int(input()) a = [int(x) for x in input().split()] b = [int(x) for x in input().split()] c = [int(x) for x in input().split()] a.sort() c.sort() def bs(left,right,aim,line): center = (right + left) // 2 if aim == line[center]: return center elif left == right: return center elif a...
s875818418
p03559
u150641538
1559241132
Python
PyPy3 (2.4.0)
py
Runtime Error
349
106980
756
n=int(input()) a=sorted(list(map(int,input().split()))) b=sorted(list(map(int,input().split()))) c=sorted(list(map(int,input().split()))) cnt=0 x=[] i=0 b__=b.copy() rev=0 while(b__): b_=b__.pop() while(1): try: c_=c.pop() except: rev+=cnt x.app...
s131652077
p03559
u859897687
1555938120
Python
Python (3.4.3)
py
Runtime Error
228
24052
410
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() i,j=0,0 m1=[] for k in a: if b[i]>k: j+=1 else: m1.append(j) for t in range(len(m1),len(b)): m1.append(j) i,j=0,0 m2=[] for k in range(n): if c[i]>k: j+=m1[b[k...
s938720913
p03559
u859897687
1555937630
Python
Python (3.4.3)
py
Runtime Error
361
37036
460
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a=list(set(a)) b=list(set(b)) c=list(set(c)) a.sort() b.sort() c.sort() i,j=0,0 d1=dict() for k in a: if b[i]>k: j+=1 else: d1[b[i]]=j i+=1 for t in range(i,len(b)): d1[b[t]]=j i,j=0,0 d2=...
s751208800
p03559
u859897687
1555937535
Python
Python (3.4.3)
py
Runtime Error
280
30744
450
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a=list(set(a)) b=list(set(b)) c=list(set(c)) a.sort() b.sort() c.sort() i,j=0,0 d1=dict() for k in a: if b[i]>k: j+=1 else: d1[b[i]]=j i+=1 for t in range(i,n): d1[b[t]]=j i,j=0,0 d2=dict(...
s424808153
p03559
u859897687
1555937181
Python
Python (3.4.3)
py
Runtime Error
165
34732
325
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) i,j=0,0 d1=dict() for k in a: if b[i]>k: j+=1 else: d1[b[i]]=j i+=1 j=0 i,j=0,0 d2=dict() for k in b: if c[i]>k: j+=d1[k] else: d2[c[i]]=j i+=1 j=0 print(sum(d2.value...
s187665779
p03559
u370331385
1555092572
Python
Python (3.4.3)
py
Runtime Error
1050
54572
1123
N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) C = list(map(int,input().split())) All = [] #全ての数字格納リスト B_A = [] #Biより小さいAjの個数格納リスト B_C = [] #Biより大きいCkの個数格納リスト for i in range(N): All.append([A[i],0]) All.append([B[i],1]) All.append([C[i],2]) All.sort() count1,count2 = 0,0 ...
s670280320
p03559
u370331385
1555092310
Python
Python (3.4.3)
py
Runtime Error
961
54512
886
N = int(input()) A = list(map(int,input().split())) B = list(map(int,input().split())) C = list(map(int,input().split())) All = [] #全ての数字格納リスト B_A = [] #Biより小さいAjの個数格納リスト B_C = [] #Biより大きいCkの個数格納リスト for i in range(N): All.append([A[i],0]) All.append([B[i],1]) All.append([C[i],2]) All.sort() count1,count2 = 0,0 ...
s722998052
p03559
u397531548
1543632463
Python
Python (3.4.3)
py
Runtime Error
196
23328
258
N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() ans=0 for j in range(N): a=bisect.bisect_left(a, B[j]) c=bisect.bisect_right(a, B[j]) ans+=a*c print(ans)
s561896550
p03559
u397531548
1543632400
Python
PyPy3 (2.4.0)
py
Runtime Error
350
105444
289
from bisect import bisect_left, bisect_right N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() ans=0 for j in range(N): a=bisect_left(a, B[j]) c=bisect_right(a, B[j]) ans+=a*c print(ans)
s787345121
p03559
u397531548
1543632350
Python
PyPy3 (2.4.0)
py
Runtime Error
362
105572
290
from bisect import bisect_left, bisect_right N=int(input()) A=list(map(int,input().split())) B=list(map(int,input().split())) C=list(map(int,input().split())) A.sort() B.sort() C.sort() ans=0 for j in range(N): a=bisect_left(a, B[i]) c=bisect_right(a, B[i]) ans+=a*c print(ans)
s730536453
p03559
u607865971
1541298127
Python
Python (3.4.3)
py
Runtime Error
364
24608
607
N = int(input()) A = [int(x) for x in input().split()] B = [int(x) for x in input().split()] C = [int(x) for x in input().split()] A = sorted(A) B = sorted(B) C = sorted(C) BB = [0] * N cidx = 0 for i in range(N): while cidx < N and C[cidx] <= B[i]: cidx += 1 BB[i] = N - cidx BBB = [0] * N for i in ...
s490920171
p03559
u607865971
1541297434
Python
Python (3.4.3)
py
Runtime Error
374
24464
639
N = int(input()) A = [int(x) for x in input().split()] B = [int(x) for x in input().split()] C = [int(x) for x in input().split()] A = sorted(A) B = sorted(B) C = sorted(C) BB = [0] * N cidx = 0 for i in range(N): while C[cidx] <= B[i]: cidx += 1 if cidx == N: break BB[i] = N - ci...
s786409400
p03559
u472675932
1535437649
Python
Python (3.4.3)
py
Runtime Error
17
2940
827
#include <iostream> #include <algorithm> #include <utility> #include <vector> #include <string> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define REP(i, n) for (int i = 0; i < (n); i++) #define RREP(i, n) for (int i = (n) - 1; i >= 0; i--) #define FOR(i, a, b) for...
s499648232
p03559
u856232850
1532736541
Python
Python (3.4.3)
py
Runtime Error
332
23328
316
n = int(input()) a = list(map(int,input().split())) b = list(map(int,input().split())) c = list(map(int,input().split())) a.sort() b.sort() c.sort() d = 0 e = 0 ans = 0 for i in b: while i > a[min(d,n-1)] and d <= n-1: d += 1 while i >= c[e] and e < n: e += 1 ans += d*(n-e) print(ans)
s928436171
p03559
u478870821
1532151463
Python
PyPy3 (2.4.0)
py
Runtime Error
186
39536
671
from sys import exit, setrecursionlimit, stderr from functools import reduce from itertools import * from collections import defaultdict from bisect import * import numpy as np def read(): return int(input()) def reads(): return [int(x) for x in input().split()] N = read() A = sorted(reads()) B = sorted(reads()...
s507287165
p03559
u520158330
1529950122
Python
Python (3.4.3)
py
Runtime Error
161
23744
384
N = int(input()) A = sorted(list(map(int,input().split()))) B = list(map(int,input().split())) C = sorted(list(map(int,input().split()))) ans = 0 #print(A) #print(C) for b in B: lenA = bisect.bisect_left(A,b) #競合時は無事無視される lenC = N - bisect.bisect_left(C,b) if b not in C else N - C.index(b) - 1 ans += lenA*...
s666410887
p03559
u476468228
1525892411
Python
Python (3.4.3)
py
Runtime Error
17
2940
896
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int,int> pp; typedef pair<ll,ll> pll; void read(int& x){ scanf("%d",&x); } void read(ll& x){ scanf("%lld",&x); } template<typename T,typename... Args> void read(T& a,Args&... b){ read(a); read(b...); } #define all(x) (x).begin(),(x).end() ...
s422580501
p03559
u299801457
1524008240
Python
Python (3.4.3)
py
Runtime Error
2105
24180
507
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() def binary_search(x,i): low = 0 high = len(x) t = (low + high) // 2 while (low<=high): if (i==x[t]): break elif (i > x[t]): low = t + 1 elif (i < x[t]): high...
s077243002
p03559
u873538240
1520363338
Python
Python (3.4.3)
py
Runtime Error
2104
23360
569
import bisect N = int(input()) As = list(map(int, input().split(' '))) Bs = list(map(int, input().split(' '))) Cs = list(map(int, input().split(' '))) As.sort() Bs.sort() Cs.sort() cnt = 0 for a in As: b_idx = bisect.bisect_left(Bs, a) while Bs[b_idx] == a and b_idx < len(Bs): b_idx += 1 if b...
s337263046
p03559
u722641375
1512620919
Python
Python (3.4.3)
py
Runtime Error
18
3064
512
def main(): K,N = map(int,input().split()) if K % 2 == 0: ans = [K//2] for i in range(N-1): ans.append(K) else: back = N // 2 mid = K // 2 + 1 ans = [mid for i in range(N)] for i in range(back): if ans[-1] == 1: ans.pop...
s876054372
p03559
u876442898
1509903755
Python
Python (2.7.6)
py
Runtime Error
222
19200
536
import numpy as np N = int(input()) a = list(map(float, input().split(" "))) b = list(map(float, input().split(" "))) c = list(map(float, input().split(" "))) sort(a) sort(c) def binary_insert_right(li, v): upper = len(li) lower = 0 while upper > lower: mid = ( upper + lower ) // 2 if v < ...
s376198511
p03559
u057916330
1509858871
Python
PyPy3 (2.4.0)
py
Runtime Error
526
119092
394
import bisect N = int(input()) A = list(set(map(int, input().split()))) B = list(set(map(int, input().split()))) C = list(set(map(int, input().split()))) ans = 0 A.sort() B.sort() C.sort() # print(A, B, C) for i in range(N): b = B[i] a_i = bisect.bisect_left(A, b) c_i = bisect.bisect_right(C, b) cnt = ...
s920063058
p03559
u238510421
1509848260
Python
Python (3.4.3)
py
Runtime Error
264
31368
463
import numpy as np n = int(input()) a_list = input().split() a_list = [int(a) for a in a_list] b_list = input().split() b_list = [int(b) for b in b_list] c_list = input().split() c_list = [int(c) for c in c_list] a_ar = np.array(a_list) b_ar = np.array(b_list) c_ar = np.array(c_list) b_count_ar = np.sum(b_ar[:,np....
s796853387
p03559
u876442898
1509847733
Python
Python (3.4.3)
py
Runtime Error
2109
24124
667
import numpy as np N = int(input()) a = np.array( list(map(float, input().split(" "))) ) b = np.array( list(map(float, input().split(" "))) ) c = np.array( list(map(float, input().split(" "))) ) # sort(a) # sort(b) # sort(c) mem_a = np.zeros(10**5) - 1 dict_c = {} def count_c(v): key = v if v in dict_c: ...
s900838973
p03559
u817328209
1509847337
Python
Python (3.4.3)
py
Runtime Error
322
23360
414
import bisect n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c = list(map(int, input().split())) a.sort(); b.sort(); c.sort() ins_c = [0]*n ins_b = [0]*n parts_comb = [0]*n for i in range(n) : ins_c = bisect.bisect_right(c, b[i]) ins_b = bisect.bisect_right(b, a[i]) an...
s259167507
p03559
u314057689
1509847064
Python
Python (3.4.3)
py
Runtime Error
222
24264
569
def main(): N = int(input()) A = sorted(list(map(int, input().split()))) B = sorted(list(map(int, input().split()))) C = sorted(list(map(lambda x: int(x)-1, input().split()))) BC = [] for i in range(N): b = B[i] BC.append(N - bisect_left(C, b)) Cum = [] S = sum(BC) ...
s892412001
p03559
u238510421
1509846974
Python
Python (3.4.3)
py
Runtime Error
1157
40144
641
import numpy as np n = int(input()) a_list = input().split() a_list = [int(a) for a in a_list] b_list = input().split() b_list = [int(b) for b in b_list] c_list = input().split() c_list = [int(c) for c in c_list] a_ar = np.array(a_list) b_ar = np.array(b_list) c_ar = np.array(c_list) # a_ar.sort() # b_ar.sort() # ...
s088949467
p03559
u596276291
1509844910
Python
Python (3.4.3)
py
Runtime Error
315
23596
937
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right INF = float("inf") from bisect import bisect, bisect_left, bisect_right # Find rightmost...
s552161791
p03560
u190952243
1592175262
Python
Python (3.4.3)
py
Runtime Error
1741
40540
410
k = int(input()) g = [[] for _ in range(k)] for i in range(1,k): g[i].append([i*10%k,0]) if i%10 != 9: g[i].append([(i+1)%k,1]) v = [100000]*k v[1] = 1 def bfs(w,d): w_nexts = g[w] for w_next in w_nexts: if v[w_next[0]] <= d + w_next[1] or d + w_next[1] > 45: continue ...
s172242156
p03560
u084411645
1591134430
Python
Python (3.4.3)
py
Runtime Error
17
2940
923
#include<bits/stdc++.h> #define all(x) x.begin(), x.end() #define pb push_back using namespace std; using ll = long long; using vi = vector<int>; const int maxn = 46, mlg = 18, rt = 1<<10, mod = 1e9 + 7; int dp[50][100003]; void mq(int &a, int b) { a = min(a, b); } int ok[100003], vis[100003]; int main() { cin.tie(0)...
s457696723
p03560
u106778233
1587865128
Python
Python (3.4.3)
py
Runtime Error
18
3060
249
def mizu(x): temp=0 while x>0: temp+=x%10 x//=10 return temp def main(): K=int(input()) ans=10**9 for i in range(1,10**8): ans=min(ans,mizu(i*k)) print(ans) if __name__ == '__main__': main()
s494558491
p03560
u905582793
1580069098
Python
Python (3.4.3)
py
Runtime Error
18
3060
133
ls = [] for i in range(1,200001): x = list(str(int(input())*i)) y = 0 for i in x: y += int(i) ls.append(y) print(min(ls))
s946354425
p03560
u368780724
1578582464
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38384
494
from collections import deque readline = sys.stdin.readline K = int(readline()) inf = 10**9+7 dist = [inf]*(K+1) dist[K] = 0 Q = deque([K]) used = [False]*(K+1) while Q: vn = Q.pop() if used[vn]: continue used[vn] = True vf = (vn*10)%K if vn%K and not used[vf]: dist[vf] = min(dist[...
s041605944
p03560
u374099594
1509849260
Python
Python (2.7.6)
py
Runtime Error
32
4744
525
K = input() while K%2==0: K /= 2 while K%5==0: K /= 5 T = [[0]*10 for _ in range(10)] for i in range(10): for j in range(10): T[i][i*j%10] = j memo = [-1]*100000 def f(x): if x==0: return 0 if memo[x]>=0: return x if memo[x]==-2: return 999999 memo[x] = -2 ...
s433355836
p03560
u783174124
1509849247
Python
Python (3.4.3)
py
Runtime Error
205
5344
333
import random random.seed(1024) K = int(input()) ans = 0 K_copy = K while K_copy > 0: ans += K_copy % 10 K_copy //= 10 maxi = int('1' * ans) maxi //= K for _ in range(10 ** 4): j = random.randint(1, maxi) M = K * j m = 0 while M > 0: m += M % 10 M //= 10 ans = min(ans, m)...
s881603095
p03561
u905582793
1591934674
Python
PyPy3 (2.4.0)
py
Runtime Error
270
55660
282
k,n = map(int,input().split()) if k%2 == 0: ans = [k//2]+[k//2+1]*(n-1) else: print(2/0) t = n//2 ans = [k//2+1]*n for i in range(t): if len(ans) < n: ans[-1] -= 1 ans.append(k) elif ans[-1] > 1: ans[-1] -= 1 else: ans.pop() print(*ans)
s890989788
p03561
u353797797
1574895638
Python
Python (3.4.3)
py
Runtime Error
181
12364
698
import sys sys.setrecursionlimit(10 ** 6) int1 = lambda x: int(x) - 1 p2D = lambda x: print(*x, sep="\n") def MI(): return map(int, sys.stdin.readline().split()) def LI(): return list(map(int, sys.stdin.readline().split())) def LLI(rows_number): return [LI() for _ in range(rows_number)] def main(): k,n=MI() i...
s463246926
p03561
u619819312
1555544087
Python
Python (3.4.3)
py
Runtime Error
2104
22548
353
a,n=map(int,input().split()) if a%2==0: print(" ".join(str(a//2)+str(a)*(n-1))) else: d=[(a+1)//2]*n r=n-1 for i in range((n-1)//2+1): if d[r]==1: d[r]=0 r-=1 else: d=d[:r]+[d[r]-1]+[a]*(n-r-1) r=n-1 while d[-1]==0: d.pop() ...
s689183445
p03561
u884982181
1545996214
Python
PyPy3 (2.4.0)
py
Runtime Error
297
73072
336
k,n = map(int,input().split()) if k %2 ==0: ans = [] ans.append(k//2) for i in range(n-1): ans.append(k) print(*ans) else: ans = [] for i in range(n): ans.append(k//2+1) sage = (n)//2 for i in range(sage): ans[-1] -=1 j = -1 while ans[j] ==0: ans[j] = k j-=1 ans[j]-...
s977871110
p03561
u497625442
1533010638
Python
Python (3.4.3)
py
Runtime Error
2104
18424
431
K, N = map(int,input().split()) #K, N = map(int,"3 14".split()) def findprev(s,N): if s[len(s)-1] == 1: z = s[0:len(s)-1] else: s[len(s)-1] -= 1 k = N - len(s) z = s + [K for _ in range(N - len(s))] return z import math t = "" if K % 2 == 0: z = list(K/2) + [K for _ in range(N-1)] else: s = [(K+1)//2 for...
s952168664
p03561
u497625442
1533008996
Python
Python (3.4.3)
py
Runtime Error
2104
7540
199
K, N = map(int,input().split()) def m(K,N): return (K**(N+1)-1)//(K-1) S = m(K,N)//2 - 1 s = "" while S >= 0: t = m(K,N-1) s = s + str(S//t+1) + " " S = S-(S//t)*t-1 # remove "" N = N-1 print(s)
s289261573
p03561
u497625442
1533008610
Python
Python (3.4.3)
py
Runtime Error
2104
7552
371
K, N = map(int,input().split()) # K, N = map(int,"5 14".split()) # 1 11 12 13 2 21 22 23 3 31 32 33 # def l(K,N): return (K**(N+1)-1)//(K-1) - 1 #=K**N+K**(N-1)+...+K def m(K,N): return (K**(N+1)-1)//(K-1) # X = l(K,N) S = m(K,N)//2 - 1 s = "" while S >= 0: t = m(K,N-1) s += str(S//t+1) s += " " #print((S,t,S//t+1...
s602505577
p03561
u495415554
1511122788
Python
Python (3.4.3)
py
Runtime Error
2155
794484
556
import itertools import math K, N = map(int, input().split()) integer = [(i + 1) for i in range(K)] # 重複順列計算 #answer = [] #for i in range(N): # for j in itertools.product(integer, repeat=(i+1)): # # ソートのために文字列変換 # answer.append(list(map(str, j))) # 重複順列計算 answer = [list(map(str, j)) for i in range(N...
s647419229
p03561
u411537765
1510024083
Python
Python (3.4.3)
py
Runtime Error
79
26532
705
import math K, N = map(int, input().split()) ans = [] if K % 2 == 0: for i in range(N): if i == 0: ans[i] = K // 2 else: ans[i] = K elif K == 1: n2 = math.ceil(N / 2) for i in range(n2): ans.append(1) else: K2 = math.ceil(K / 2) n2 = math.floor(N / 2...
s843626163
p03561
u340781749
1509852442
Python
Python (3.4.3)
py
Runtime Error
2105
19700
669
def solve(k, n): if k & 1 == 0: return [k // 2] + [k] * (n - 1) xs = [((k ** i - 1) // (k - 1)) for i in range(1, -1)] xs = [((k ** i - 1) // (k - 1)) for i in range(n + 1, 1, -1)] tgt = xs[0] // 2 - 1 mk1 = k // 2 mk2 = mk1 + 1 l = xs[1] * mk1 ans = [] for i in range(1, n - ...
s725967436
p03561
u979554218
1509850199
Python
Python (3.4.3)
py
Runtime Error
2110
108520
516
from math import ceil k, n = [int(x) for x in input().strip().split()] li = [pow(k, i) for i in range(1, n+1)] for i in range(1, n): li[i] += li[i-1] li.reverse() li.append(0) li.append(-1) target = ceil(li[0] / 2) results = [] #print(li) def f(i, target): if target == 0: return if li[i] == -1: ...
s102760926
p03561
u484655382
1509849537
Python
Python (3.4.3)
py
Runtime Error
18
3060
401
import sys sys.setrecursionlimit(100500) def F(n): return (k**n - 1) // (k - 1) l = 0 def go(x, n): global l if (x == 1): return x -= 1 t = F(n) c = ((x - 1) // t) print(c + 1, end = ' ') go(x - c * t, n - 1) k, n = [int(i) for i in input().split()] if k % 2 == 0: print(k // 2. end = ' ') for i in range(...
s599691788
p03561
u484655382
1509849473
Python
Python (3.4.3)
py
Runtime Error
2117
218132
304
import sys sys.setrecursionlimit(100500) def F(n): return (k**n - 1) // (k - 1) l = 0 def go(x, n): global l if (x == 1): return x -= 1 t = F(n) c = ((x - 1) // t) print(c + 1, end = ' ') go(x - c * t, n - 1) k, n = [int(i) for i in input().split()] res = F(n) * k go((res + 1) // 2 + 1, n)
s145915041
p03561
u340781749
1509849460
Python
Python (3.4.3)
py
Runtime Error
2105
19700
539
def solve(k, n): if k & 1 == 0: return [k // 2] + [k] * (n - 1) xs = [((k ** i - 1) // (k - 1)) for i in range(n + 1, 1, -1)] tgt = xs[0] // 2 - 1 mk = k // 2 + 1 l = xs[1] * (k // 2) for i in range(1, n - 1): if l == tgt: return [mk] * i if l > tgt: ...
s760578960
p03561
u327466606
1509849331
Python
Python (3.4.3)
py
Runtime Error
140
26572
403
from itertools import chain,repeat K,N = map(int,input().split()) def dec(seq): if seq[-1] == 1: seq.pop() else: seq[-1] -= 1 if len(seq) < N: seq += list(repeat(K,N-len(seq))) return seq if K % 2 == 0: print(' '.join(chain((K-1,),repeat(K,N-1)))) else: seq = list(repeat(K//2+1,N)) d = (...
s013519302
p03561
u327466606
1509849251
Python
Python (3.4.3)
py
Runtime Error
138
26572
401
from itertools import chain,repeat K,N = map(int,input().split()) def dec(seq): if seq[-1] == 1: seq.pop() else: seq[-1] -= 1 if len(seq) < N: seq += list(repeat(K,N-len(seq))) return seq if K % 2 == 0: print(' '.join(chain((K-1,),repeat(K,N-1)))) else: seq = list(repeat(K//2+1,N)) d = (...
s380596808
p03561
u667084803
1509847366
Python
Python (3.4.3)
py
Runtime Error
83
26316
137
K,N=map(int,input().split()) if K%2==0: L=[K//2]+[K]*(N-1) print(' '.join(map(str, L))) else: l=K//2 L=[K//2+1]*(N-l)+[l]*l pri
s874962789
p03563
u365156087
1599762494
Python
Python (3.8.2)
py
Runtime Error
29
8800
26
print(chr(ord(input())+1))
s435073607
p03563
u365156087
1599762418
Python
Python (3.8.2)
py
Runtime Error
26
8856
32
s = input() print(chr(ord(s)+1))
s425748249
p03563
u445807804
1599090909
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74648
132
#include <bits/stdc++.h> using namespace std; int main() { int R; int G; cin >> R; cin >> G; cout << G*2-R << endl; }