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
s263380631
p03588
u619631862
1506820128
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38640
83
n=i1() x=[] for i in range(n): x.append(i2()) x.sort() print(x[-1][0]+x[-1][1])
s709705448
p03589
u751488284
1598481801
Python
Python (3.8.2)
py
Runtime Error
26
9228
501
N = int(input()) A = [int(input()) for i in range(N)] A.sort() left = A[0] right = A[N - 1] ans = right - left for i in range((N - 2) // 2): if i % 2 == 0: ans += right - A[1 + i] ans += A[N - 2 - i] - left right = A[1 + i] left = A[N - 2 - i] else: ans += left - A[1 + i...
s330154251
p03589
u607075479
1596996048
Python
Python (3.8.2)
py
Runtime Error
2206
9248
159
N = int(input()) for h in range(1, 3501): for n in range(1, 3501): a = N*h*n b = 4*h*n - N*n - N*h if a % b: continue print(h, n, a//b)
s120826066
p03589
u189762886
1589342279
Python
Python (3.4.3)
py
Runtime Error
18
3064
231
a = input() for h in range(1, 3501): for n in range(1, 3501): for w in range(1, 3501): if 4/a == 1/h + 1/n + 1/w: print(h, n, w) break else: continue break else: continue break
s107063604
p03589
u263824932
1584042748
Python
Python (3.4.3)
py
Runtime Error
2104
5176
446
from fractions import Fraction N=int(input()) list=[] for a in range(1,3*N//4+1): X=Fraction(4,N)-Fraction(1,a) for b in range(a,2//X+1): if not 4*a*b-b*N-a*N==0: c=N*a*b//(4*a*b-b*N-a*N) if c<b : continue else: list.append(a) ...
s652794543
p03589
u366959492
1572021388
Python
PyPy3 (2.4.0)
py
Runtime Error
357
41316
229
N=int(input()) for h in range(1,3501): for n in range(1,3501): if 4/N-1/h-1/n==0: continue w=(N*h*n)/(4*h*n-N*n-h*N) if w==int(w) and w>=1: print(h,n,int(w)) exit()
s016263241
p03589
u227082700
1565059245
Python
Python (3.4.3)
py
Runtime Error
1825
3060
134
N=int(input()) for h in range(1,3501): for n in range(1,3501): w=(N*h*n)/(4*h*n-N*(h+n)) if w%1==0:print(h,n,int(w));exit()
s758188949
p03589
u513900925
1555732024
Python
Python (3.4.3)
py
Runtime Error
583
3188
506
N = int(input()) p = N//4 s=1 r=1 t=1 for i in range(2*p,3500): for j in range(2*p,3500): for l in range(p,3500): if (i*j + j*l + l*i)*N//(i*j*l) == 4: i =str(i) j=str(j) l=str(l) print(i+" "+j+" "+l) s=int(l) ...
s453177414
p03589
u017810624
1549182635
Python
Python (3.4.3)
py
Runtime Error
18
3060
180
n=int(input()) x=time.time() for i in range(1,3501): for j in range(2,3501): p=4*i*j-n*(i+j) if p>0: q=n*i*j if q%p==0: print(i,j,q//p) exit()
s227656112
p03589
u106297876
1542439274
Python
Python (3.4.3)
py
Runtime Error
17
2940
275
N = int(input()) ans = 0 while ans == 0: for h in range(3500): h = h + 1 for n in range(3500): n = n + 1 up = 4*h*n - n*N - N*h down = N*h*n if up 0: if down % up == 0: w = down // up ans = 1 break if ans == 1: break print(h, n , w)
s218541751
p03589
u106297876
1542439204
Python
Python (3.4.3)
py
Runtime Error
17
3064
275
N = int(input()) ans = 0 while ans == 0: for h in range(3500): h = h + 1 for n in range(3500): n = n + 1 up = 4*h*n - n*N - N*h down = N*h*n if up > 0: if down % up == 0: w = down // up ans = 1 break if ans == 1: break print(h, n , w
s337868128
p03589
u106297876
1542439120
Python
Python (3.4.3)
py
Runtime Error
17
3060
275
N = int(input()) ans = 0 while ans == 0: for h in range(3500): h = h + 1 for n in range(3500): n = n + 1 up = 4*h*n - n*N - N*h down = N*h*n if up > 0: if down % up == 0: w = down // up ans = 1 break if ans == 1: break print(h, n , w
s312323099
p03589
u454481887
1540694397
Python
Python (3.4.3)
py
Runtime Error
18
2940
106
m = int(input()) for n in(m): if(n > 100): ans+=n elif(n < 100): ans*=n print(ans)
s654787839
p03589
u562935282
1540686512
Python
Python (3.4.3)
py
Runtime Error
1751
2940
211
n = int(input()) for x in range(1, 3500 + 1): for y in range(1, 3500 + 1): p = n * x * y q = 4 * x * y - n * (x + y) if p % q == 0: print(x, y, p // q) exit()
s948490735
p03589
u562935282
1540686437
Python
Python (3.4.3)
py
Runtime Error
2104
3444
210
n = int(input()) for x in range(1, 3500 + 1): for y in range(1, 3500 + 1): p = n * x * y q = 4 * x * y - n * (x + y) if p % q == 0: print(p, q, p // q) break
s209750146
p03589
u844789719
1540665807
Python
Python (3.4.3)
py
Runtime Error
1121
3064
398
N = int(input()) maxh = int(3 * N / 4) for h in range(1, min(maxh, 3501)): maxn = int(2 / (4 / N - 1 / h)) for n in range(h, min(maxn, 3501)): w_reciprocal = (4 / N) - (1 / h) - (1 / n) if w_reciprocal > 0: w = 1 / w_reciprocal if w < 3501 and int(w) == w: ...
s954472378
p03589
u834415466
1540156096
Python
Python (3.4.3)
py
Runtime Error
130
3064
444
N=int(input()) def ok(h,n,w,N): if 4*h*n*w==N*(n*w+n*h+h*w): return 1 else: return 0 def kiyaku(a,b): if b%a==0: return 1 else: return 0 def solve(N): for i in range(N//4+1,3*N//4+1): for j in range(3*N//4+1,3501): if kiyaku(4*i*j-N*(i+j),N*i*j)...
s646786559
p03589
u820351940
1539910521
Python
Python (3.4.3)
py
Runtime Error
2108
14408
273
import numpy as np import itertools N = int(input()) k = 4 / N def f(h, n): hn = h * n return -(hn / (n + h - hn * k)) for h, n in itertools.permutations(range(3500), r=2): w = f(h, n) if w % 1 == 0 and 0 < w: print(int(w), h, n) exit()
s497247186
p03589
u177040005
1539744007
Python
PyPy3 (2.4.0)
py
Runtime Error
405
41580
274
N = int(input()) for h in range(1,3501): n_min = N //(4*h) + (N%(4*h)) * 1 for n in range(n_min,3501): if (N*(h+n)) % (4*h*n-N) == 0: w = N*(h+n) // (4*h*n-N) print(h,n,w) # print(N*(h+n+w) , (4*h*n*w)) exit()
s841617571
p03589
u766407523
1526855877
Python
Python (3.4.3)
py
Runtime Error
17
2940
399
#include<bits/stdc++.h> using namespace std; int main(void){ long long n, h, w; long long N, p, q; cin >> N; bool end = false; for(h = 1; h<=3500; h++){ for(n = 1; n<=3500; n++){ p = 4*h*n-N*n-N*h; q = N*h*n; if(p>0 && q%p == 0){ w = q / p; cout << h << " " << n << " " <...
s214964854
p03589
u215693191
1511498717
Python
Python (2.7.6)
py
Runtime Error
11
2568
18789
#include "bits/stdc++.h" using namespace std; //HEAD_OF_CONFIG_ static const int MOD=1000000007; //1000000000000000003LL static const double eps=1e-8; //TAIL_OF_CONFIG_ //[HEAD_OF_JKI'S_HEADER_ //TYPEDEF typedef long long lld; typedef unsigned long long u64; typedef pair<int, int> pii; //COMPA...
s024916318
p03589
u215693191
1511496712
Python
Python (2.7.6)
py
Runtime Error
2104
2568
475
def gcd(x, y): while y!=0: x, y = y, x%y return x def process(): n = int(raw_input().strip()) for x in xrange(n>>2, 3501): for y in xrange(x, 3501): b = x*y/gcd(x, y) b = b*n/gcd(b, n) a = b*4/n a -= b/x a -= b/y r ...
s672449658
p03589
u540307496
1507431255
Python
Python (3.4.3)
py
Runtime Error
2104
3064
323
N = int(input()) flag = False for i in range(1,3500): for j in range(1,3500): if((N*i*j)%(4*i*j - N*i - N*j) == 0 and (4*i*j - N*i - N*j) > 0): w = int((N*i*j)%(4*i*j - N*i - N*j)) h = i n = j flag = True break if flag: break print(h,n...
s735620005
p03589
u540307496
1507431128
Python
Python (3.4.3)
py
Runtime Error
2104
3064
339
N = int(input()) # h,n,w flag = False for i in range(1,3500): for j in range(1,3500): if((N*i*j)%(4*i*j - N*i - N*j) == 0 and (N*i*j)/(4*i*j - N*i - N*j) > 0): w = int((N*i*j)%(4*i*j - N*i - N*j)) h = i n = j flag = True break if flag: ...
s735782449
p03589
u248556072
1507165211
Python
Python (3.4.3)
py
Runtime Error
2104
2940
284
# -*- coding: utf-8 -*- # 文字列の入力 N = int(input()) for h in range(1,3500): for n in range(1,3500): w_num = N * h * n w_den = 4*h*n - N*n - N*n if (w_num % w_den == 0): print(str(h)+" "+str(n)+" "+str(w_num/w_den)) break
s004698533
p03589
u266272131
1506881768
Python
Python (3.4.3)
py
Runtime Error
18
2940
249
import sys N = int(input()) for i in range(1,3501): for j in range(i,3501): print(i,j) if 4*i*j-N*i-N*j > 0: if (N*i*j)%(4*i*j-N*i-N*j) == 0: print(i,j,int((N*i*j)/(4*i*j-N*i-N*j))) sys.exit()
s476170678
p03589
u558720836
1506872418
Python
Python (2.7.6)
py
Runtime Error
865
2820
328
def print_ans(): N = int(input()) for n in range(1,3501): for h in range(1,3501): v = (4 * n * h - N * n - N * h) if v < 0: continue w , mod = divmod(N * h * n, v) if not mod: print w, h, n return prin...
s420644642
p03589
u558720836
1506872101
Python
Python (2.7.6)
py
Runtime Error
1280
2948
337
def print_ans(): N = int(input()) for n in range(1,3501): for h in range(1,3501): v = (4 * n * h - N * n - N * h) x = (n * h * N) if v < 0: continue if not x % v: print x / v, h, n return ...
s983797122
p03589
u558720836
1506871288
Python
Python (2.7.6)
py
Runtime Error
939
2948
372
def print_ans(): N = input() for n in range(1,3501): for h in range(1,3501): v = (4 * n * h - N * n - N * h) if v < 0: continue w, mod = divmod(n * h * N, v) if not mod: print w, h, n ret...
s184557045
p03589
u558720836
1506869732
Python
Python (2.7.6)
py
Runtime Error
2104
2820
246
if __name__ == '__main__': N = input() for n in range(1,3501): for h in range(1,3501): w = n * h * N / (4 * n * h - N * n - N * h) if isinstance(w, int) and w > 0: break print w, h, n
s831811131
p03589
u160414758
1506841174
Python
Python (3.4.3)
py
Runtime Error
2104
3060
200
N = int(input()) i,j = 1,1 for x in range(i,3501): for y in range(j,3501): z = N*x*y/(4*x*y - N*y - N*x) if z == int(z) and z >= 1: print(x,y,int(z)) exit()
s967529993
p03589
u160414758
1506841009
Python
Python (3.4.3)
py
Runtime Error
1962
3064
373
N = int(input()) i,j = 1,1 while i<3501 and j<3501: if N/i >= 4: i += i continue if N/j >= 4: j += j continue i = i//2 j = j//2 for x in range(i,3501): for y in range(j,3501): z = N*x*y/(4*x*y - N*y - N*x) if z == int(z) and z >= 1: ...
s207729689
p03589
u352623442
1506827126
Python
Python (3.4.3)
py
Runtime Error
2107
3188
397
N= int(input()) d =[] import math for a in range(1, 1+math.floor(N*3/4)): if 4*a>N: for b in range(1, 1+math.floor((2*a*N)/(4*a-N))): x = 4/N y = (1/a)+(1/b) if x > y: c = 1/((4/N)-(1/a)-(1/b)) if c == int(c): d.append([...
s642725896
p03589
u785205215
1506826977
Python
Python (3.4.3)
py
Runtime Error
17
3064
389
N = int(input()) flag = False memo = {} for a in range(1,3500)[::-1]: for b in range(1,3500)[::-1]: if (a,b) not in memo: memo[(b,a)] = True if (N*a*b)%(4*a*b -N*n - N*b) == 0: c = int((N*a*b)/(4*a*b -N*n - N*b)) flag = True break ...
s852423524
p03589
u785205215
1506826870
Python
Python (3.4.3)
py
Runtime Error
17
3064
403
n = int(input()) flag = False memo = {} for a in range(1,3500)[::-1]: for b in range(1,3500)[::-1]: if (a,b) not in memo: memo[(b,a)] = True if (N*a*b)%(4*a*b -N*n - N*b) == 0: c = int((N*a*b)/(4*a*b -N*n - N*b)) flag = True ...
s820759135
p03589
u352623442
1506826812
Python
Python (3.4.3)
py
Runtime Error
2104
3064
378
N= int(input()) d =[] import math for a in range(1, 1+math.floor(N*3/4)): if 4*a>N: for b in range(1, 1+math.floor((2*a*N)/(4*a-N))): x = 4/N y = (1/a)+(1/b) if x > y: c = 1/((4/N)-(1/a)-(1/b)) if c == int(c): d.append([...
s643774331
p03589
u780709476
1506826016
Python
Python (3.4.3)
py
Runtime Error
214
5688
345
from fractions import Fraction as F N = int(input()) left = F(4, N) for i in range(1, 3500): if(left > F(1, i)): h = i break for i in range(1, 3500): if(left > F(1, h) + F(1, i)): n = i break for i in range(1, 3500): if(left == F(1, h) + F(1, n) + F(1, i)): w = i ...
s149389158
p03589
u839537730
1506825749
Python
Python (3.4.3)
py
Runtime Error
24
3064
476
import math N = int(input()) if N%2 == 0: print(N, N, N//2) else: flag = False H = math.ceil(N/4) for h in range(H, 10000): if flag == True: break N_ = math.ceil((N*h)/(h*4-N)) for n in range(N_, 10000): if flag == True: br...
s824150702
p03589
u780709476
1506825736
Python
Python (3.4.3)
py
Runtime Error
90
5688
332
from fractions import F N = int(input()) left = F(4, N) for i in range(1, 3500): if(left > F(1, i)): h = i break for i in range(1, 3500): if(left > F(1, h) + F(1, i)): n = i break for i in range(1, 3500): if(left > F(1, h) + F(1, n) + F(1, i)): w = i break pri...
s116438078
p03589
u780709476
1506825619
Python
Python (3.4.3)
py
Runtime Error
77
5688
332
from fractions import F N = int(input()) left = F(4, N) for i in range(1, 3500): if(left > F(1, i)): h = i break for i in range(1, 3500): if(left > F(1, h) + F(1, i)): n = i break for i in range(1, 3500): if(left > F(1, h) + F(1, n) + F(1, i)): w = i break pri...
s881368869
p03589
u780709476
1506825614
Python
Python (3.4.3)
py
Runtime Error
176
5688
332
from fractions import F N = int(input()) left = F(4, N) for i in range(1, 3500): if(left > F(1, i)): h = i break for i in range(1, 3500): if(left > F(1, h) + F(1, i)): n = i break for i in range(1, 3500): if(left > F(1, h) + F(1, n) + F(1, i)): w = i break pri...
s016732226
p03589
u839537730
1506825564
Python
Python (3.4.3)
py
Runtime Error
26
3316
487
import math N = int(input()) if N%2 == 0: print(N, N, N//2) else: flag = False H = math.ceil(N/4) for h in range(H, 3501): if flag == True: break N_ = math.ceil((N*h)/(h*4-N)) for n in range(N_, 3501): if flag == True: brea...
s315516533
p03589
u813098295
1506825019
Python
Python (2.7.6)
py
Runtime Error
10
2568
160
# coding: utf-8 import math N = int(raw_input()) h = int(math.ceil(N/4.0)) n = int(math.ceil(h*4*N/4.0/(h*4-N))) w = 11451419198101145141919810 print h, n, w
s858474973
p03589
u780709476
1506824750
Python
Python (3.4.3)
py
Runtime Error
19
3064
319
N = int(input()) h = n = w = 0 for i in range(1, 3500): if(4.0 / N > 1.0 / i): h = i break for i in range(1, 3500): if(4.0 / N > 1.0 / h + 1.0 / i): n = i break for i in range(1, 3500): if(4.0 / N == 1.0 / h + 1.0 / n + 1.0 / i): w = i break print(h, n, w)
s234249002
p03589
u855200003
1506824452
Python
Python (3.4.3)
py
Runtime Error
17
2940
358
%%cython N = int(input()) flag = 0 for a in range(1,3501): if flag == 1: break for b in range(1,3501): M = (4*a*b - N*a - N*b) C = N*a*b if M < 0 : continue elif M != 0: if C//M == C/M: c = C//M print(a,b,c) ...
s001762337
p03589
u813098295
1506824433
Python
Python (2.7.6)
py
Runtime Error
14
2568
147
# coding: utf-8 import math N = int(raw_input()) h = int(math.ceil(N/4.0)) n = int(math.ceil(h*4*N/4.0/(h*4-N))) w = 1145141919810 print h, n, w
s682039957
p03589
u540307496
1506824361
Python
Python (3.4.3)
py
Runtime Error
1567
3316
650
N = int(input()) # h,n,w temp = int((3*N)/4) if (temp >= 3500): temp = 3500 hlist = [i for i in range(temp,0,-1)] flag = False for i in hlist: temp = 4/N - 1/i if(temp > 0): al = int(2 / temp) if (al >= 3500): al = 3500 nlist = [ii for ii in range(al,0,-1)] for j ...
s601566101
p03589
u813098295
1506824293
Python
Python (2.7.6)
py
Runtime Error
10
2568
163
# coding: utf-8 import math N = int(raw_input()) h = int(math.ceil(N/4.0)) n = int(math.ceil(h*4*N/4.0/(h*4-N))) w = int(math.ceil(N*n*h-4*n-4*h)) print h, n, w
s502500868
p03589
u794603719
1506824044
Python
Python (3.4.3)
py
Runtime Error
2104
3064
1117
import math num = int(input()) ans = [0,0,0] value = 4 / num limit = [math.ceil(num/4),0.0,0.0] flag = 0 # print(limit) if num % 4 == 0: a = int(num*3 / 4) print(a,a,a) flag = 1 a = limit[0] remain = value - 1/a b = math.ceil(1/remain) remain = value - 1/a - 1/b c = math.ceil(1/remain) if(value == 1/a + 1/...
s148470001
p03589
u639444166
1506823746
Python
Python (2.7.6)
py
Runtime Error
11
2696
711
#!usr/bim/python #! -*- coding: utf-8 -*- import math nyu = raw_input() nyu = int(nyu) if nyu % 2 == 0: h = nyu n = nyu w = nyu / 2 elif nyu % 4 == 1: h = nyu / 4.0 h = math.ceil(h) h = int(h) if h % 3 == 0: n = nyu*h/3*2 w = nyu*h/3*2 elif h % 2 == 0: n = nyu*...
s825724597
p03589
u540307496
1506823619
Python
Python (3.4.3)
py
Runtime Error
2107
283312
484
N = int(input()) # h,n,w temp = int((3*N)/4) hlist = [i+1 for i in range(temp)] flag = False for i in hlist: temp = 4/N - 1/i nlist = [i+1 for i in range(int(2/temp))] for j in nlist: beta = 4/N - 1/i - 1/j if (beta > 0): if(1/beta == int(1/beta)): w = int(1/beta)...
s356162685
p03589
u054556734
1506823418
Python
Python (3.4.3)
py
Runtime Error
18
2940
683
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> #include<cctype> #include<stack> #include<queue> #include<vector> #include<set> #include<map> #include<algorithm> using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; int main(){ int n, flag=0; ll x,y; ...
s548145067
p03589
u708658376
1506822569
Python
PyPy3 (2.4.0)
py
Runtime Error
249
39280
341
n = int(input()) def solve(n): for x in range(1, 3501): nx = n * x for y in range(x, 3501): # 4/n = 1/x + 1/y + 1/z # 1/z = 4/n - 1/x - 1/y # z = 1/(4/n - 1/x - 1/y) # z = nxy/(4xy - ny - nx) nxy = nx * y den = 4*x*y - n*y -nx if (nxy % den == 0 and nxy//den > 0): print(x, y, nxy//den) ...
s856976693
p03589
u026537738
1506822370
Python
Python (3.4.3)
py
Runtime Error
2104
3064
453
from math import ceil N = int(input()) max_w = 3*N/4 if max_w % 1 == 0: max_w += 1 ans = "" for w in range(1,ceil(max_w)): max_n = 2/(4/N - 1/w) if max_n % 1 == 0: max_n += 1 for n in range(1,ceil(max_n)): if 4/N - 1/n - 1/w == 0: continue h = 1/(4/N - 1/n - 1/w) ...
s182341504
p03589
u026537738
1506821361
Python
Python (3.4.3)
py
Runtime Error
17
3064
271
from math import ceil N = int(input()) max_w = 3*N/4 for w in range(1,ceil(max_w),-1): max_n = 2/(4/N - 1/w) for n in range(1,ceil(max_n),-1): h = 1/(4/N - 1/n - 1/w) if h % 1 == 0: ans = str(h) + " " + str(n) + " " + str(w) print(ans)
s179278703
p03589
u354915818
1506821069
Python
Python (3.4.3)
py
Runtime Error
2104
3060
349
# coding: utf-8 # Here your code ! N = int(input()) w = 0 for h in range(1 , 3501) : if w != 0 : break x = 4 / N - 1 / h if x <= 0 : continue for n in range(1 , 3501) : y = x - 1/n if y <= 0 : continue if n % (x*n - 1) == 0 : w = int(n / (n*x - 1)) br...
s787333686
p03590
u786020649
1596230525
Python
Python (3.8.2)
py
Runtime Error
370
35776
486
import sys readline=sys.stdin.readline read=sys.stdin.read def main(): n,k=map(int,readline().split()) ab=[list(map(int,l.split())) for l in read().splitlines()] ek=0 while k>>ek: ek+=1 ans=0 for i in range(ek): if k>>i&1: m=(k>>(i+1))<<(i+1)|((1<<i)-1) ...
s031853931
p03590
u691896522
1581464328
Python
Python (3.4.3)
py
Runtime Error
2105
24956
877
import copy import sys input = sys.stdin.readline n,k = map(int, input().split()) data = [] bit_k = format(k, 'b') len_k = len(bit_k) for i in range(n): a, b = map(int, input().split()) if a <= k: tmp = format(a, 'b') tmp = tmp.zfill(len_k) data.append([tmp,b]) def check_value(bit): ...
s575468465
p03590
u497596438
1555786440
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
50592
578
from collections import defaultdict from copy import deepcopy from math import log N,K=map(int,input().split()) AB=[0]*N dic=defaultdict(int) #n=int(ceil(log(K,2)))+1 for i in range(N): a,b=map(int,input().split()) if a in dic.keys(): AB[dic[a]]=[a,AB[dic[a]][1]+b] else: dic[a]=i AB[...
s759360428
p03590
u497596438
1555784460
Python
PyPy3 (2.4.0)
py
Runtime Error
2106
51732
973
from math import ceil from itertools import permutations from heapq import * from collections import defaultdict from copy import deepcopy from math import log N,K=map(int,input().split()) AB=[0]*N dic=defaultdict(int) n=int(ceil(log(K,2)))+1 for i in range(N): a,b=map(int,input().split()) if a in dic.keys(): ...
s256013811
p03590
u497596438
1555784127
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
51724
810
from math import ceil from collections import defaultdict from math import log N,K=map(int,input().split()) AB=[0]*N dic=defaultdict(int) n=int(ceil(log(K,2)))+1 for i in range(N): a,b=map(int,input().split()) if a in dic.keys(): AB[dic[a]]=[a,AB[dic[a]][1]+b] else: dic[a]=i AB[i]=[...
s965207032
p03590
u497596438
1555781681
Python
PyPy3 (2.4.0)
py
Runtime Error
2110
51712
1175
from math import sqrt from math import ceil from itertools import permutations from heapq import * from collections import defaultdict from copy import deepcopy from math import log N,K=map(int,input().split()) AB=[0]*N dic=defaultdict(int) n=int(ceil(log(K,2)))+1 for i in range(N): a,b=map(int,input().split()) ...
s256462474
p03590
u497596438
1555737609
Python
PyPy3 (2.4.0)
py
Runtime Error
171
39024
691
N,K=map(int,input().split()) AB=[0]*N dic=defaultdict(int) for i in range(N): a,b=map(int,input().split()) if a in dic.keys(): AB[dic[a]]=[a,AB[dic[a]][1]+b] else: dic[a]=i AB[i]=[a,b] AB_=[] for i in AB: if i==0: continue k=bin(i[0])[2:].zfill(4) AB_.append([k,i[...
s826908550
p03590
u314906167
1540740830
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38640
404
import sys from math import log2 N, K = map(int, input().split()) AB = [] for _ in range(N): AB.append([int(s) for s in input().split()]) ans = sum([b for a, b in AB if K | a == K]) for i in range(int(log2(K) // 1), 0, -1): if not K & (1 << i): continue km = K & ~(1 << i) | (1 << i) - 1 ansca...
s335831663
p03590
u528388170
1540091250
Python
Python (3.4.3)
py
Runtime Error
2150
1540596
265
N,K=map(int,input().split()) A=[[int(i) for i in input().split()] for j in range(N)] def max_(A,n): B=[0]*(n+1) for [w,p] in A: for j in range(n,w-1,-1): if B[j-w]+p>B[j]: B[j]=B[j-w]+p return max(B) print(max_(A,K))
s040858383
p03590
u503052349
1507317182
Python
Python (3.4.3)
py
Runtime Error
2139
530968
413
N,K = map(int,input().split()) masks = [K] bs = str(bin(K))[2:] for i in range(len(bs) - 1): if bs[i] == '1': a = len(bs) - 1 - i mask = K - (1 << a) mask |= ((1 << a) - 1) masks.append(mask) anss = [0 for i in range(K)] for i in range(N): a,b = map(int,input().split()) for...
s833794371
p03590
u205803237
1506825584
Python
Python (3.4.3)
py
Runtime Error
1066
3064
545
N, K = map(int, input().split()) k = format(K, '031b') n = k.find("1") ans = 0 for i in range(N): judge = 0 a, b = map(int, input().split()) a = format(a, '031b') for j in range(n+1, 31): if (k[j] == 0) and (a[j] == 1): judge = 1 break if (k[j] == 1) and (a[j] ==...
s941902553
p03590
u137747137
1506825548
Python
Python (2.7.6)
py
Runtime Error
2105
18228
752
#!/usr/bin/env python #-*- coding: utf-8 -*- if __name__ == "__main__": N, K = map(int, raw_input().split()) A = [] B = [] C...
s806153473
p03590
u708658376
1506825482
Python
PyPy3 (2.4.0)
py
Runtime Error
175
38384
571
def solve(K, ABs): if not ABs: return 0 ansK = sum(b for a, b in ABs if (K | a) == K) pool = [] for i in range(30, -1, -1): if (K & (1<<i)): pool.append(i) for p in pool: v = 1 << p KK = (K >> p) << p KKK = (K >> p) t = sum(b for a, b in ABs if (no...
s124149041
p03590
u190405389
1506825288
Python
Python (3.4.3)
py
Runtime Error
2108
89304
316
n, k = map(int, input().split()) ab = [list(map(int, input().split())) for i in range(n)] l = [] a = 0 for i in range(30): if k > 2 ** i: a = i for i in range(2 ** a, k): ans = 0 for j in range(n): if i == ab[j][0] | i: ans += ab[j][1] l.append(ans) print(max(l))
s186233288
p03590
u616651250
1506825287
Python
Python (3.4.3)
py
Runtime Error
501
21416
464
# coding: utf-8 # Here your code ! N,K=map(int,input().rstrip().split()) lst=[] for i in range(N): A,B=map(int,input().rstrip().split()) C=B/A tpl=(A,B,C) lst.append(tpl) lst.sort( key=lambda x:x[1], reverse=True ) lst.sort( key=lambda x:x[2], reverse=True ) # for j in lst: # print(j) maxKey=0 ...
s707077168
p03590
u007808656
1506825179
Python
Python (3.4.3)
py
Runtime Error
17
2940
193
res=0 for d in range(K): tmp_res=0 for key in data.keys(): if(key|d==d): tmp_res+=data[key] #print(d,tmp_res) if(tmp_res>res): res=tmp_res print(res)
s941560444
p03590
u007808656
1506825080
Python
PyPy3 (2.4.0)
py
Runtime Error
181
38640
193
res=0 for d in range(K): tmp_res=0 for key in data.keys(): if(key|d==d): tmp_res+=data[key] #print(d,tmp_res) if(tmp_res>res): res=tmp_res print(res)
s645483941
p03590
u708658376
1506824893
Python
Python (3.4.3)
py
Runtime Error
18
2940
551
def solve(K, ABs): if not ABs return 0 ansK = sum(b for a, b in ABs if (K | a) == K) pool = [] for i in range(30, -1, -1): if (K & (1<<i)): pool.append(i) else: if pool: break for p in pool: v = 1 << p t = sum(b for a, b in ABs ...
s791688263
p03590
u743272507
1506824683
Python
Python (3.4.3)
py
Runtime Error
351
3444
340
from math import log2 n,k = map(int,input().split()) loglen = 2**int(log2(k)) pud = 2**(int(log2(k - loglen))) - 1 + loglen pud2 = loglen-1 ansk = 0 ansp = 0 ans2 = 0 for _ in range(n): a,b = map(int,input().split()) if a|k == k: ansk += b if a|pud == pud: ansp += b if a|pud2 == pud2: ans2 += b print(...
s094077081
p03590
u616651250
1506824260
Python
Python (3.4.3)
py
Runtime Error
1239
25540
493
# coding: utf-8 # Here your code ! from collections import deque N,K=map(int,input().rstrip().split()) lst=[] for i in range(N): A,B=map(int,input().rstrip().split()) C=B/A tpl=(A,B,C) lst.append(tpl) lst.sort( key=lambda x:x[1], reverse=True ) lst.sort( key=lambda x:x[2], reverse=True ) for j in l...
s929248055
p03590
u698535708
1506821784
Python
Python (3.4.3)
py
Runtime Error
2122
264384
464
import sys sys.setrecursionlimit(100001) def dp(a,k): if a==N: return 0 if k in t[a]: return t[a][k] kk = k|A[a] if kk > K: ret = dp(a+1,k) else: ret = max(dp(a+1,k), dp(a+1,kk)+B[a]) t[a][k] = ret return ret N, K = map(int, input().split()) A = [0 for i ...
s106216675
p03590
u698535708
1506821662
Python
Python (3.4.3)
py
Runtime Error
402
42576
421
def dp(a,k): if a==N: return 0 if k in t[a]: return t[a][k] kk = k|A[a] if kk > K: ret = dp(a+1,k) else: ret = max(dp(a+1,k), dp(a+1,kk)+B[a]) t[a][k] = ret return ret N, K = map(int, input().split()) A = [0 for i in range(N)] B = [0 for i in range(N)] t = ...
s462073444
p03590
u698535708
1506821460
Python
Python (3.4.3)
py
Runtime Error
367
13924
321
def dp(a,k): if a==N: return 0 kk = k|A[a] if kk > K: return dp(a+1,k) else: return max(dp(a+1,k), dp(a+1,kk)+B[a]) N, K = map(int, input().split()) A = [0 for i in range(N)] B = [0 for i in range(N)] for i in range(N): A[i], B[i] = map(int, input().split()) print(dp(0,0)...
s850228641
p03591
u626337957
1601341872
Python
PyPy3 (7.3.0)
py
Runtime Error
253
68036
159
H, W, K = map(int, input().split()) for h in range(0, H+1): for w in range(0, W+1): if h*W + w*H - h*w == K: print('Yes') exit() print('No')
s155060143
p03591
u619557935
1598590677
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74672
279
from collections import deque n, m, k = map(int, input().split()) ans = [] for i in range(0, n + 1): for j in range(0, m + 1): cnt = (i * m) + (j * n) - 2 * (i * j) # print(i, j, cnt) ans.append(cnt) if k in ans: print("Yes") else: print("No")
s855748396
p03591
u882575405
1597039388
Python
Python (3.8.2)
py
Runtime Error
22
8852
87
s = input() if len(s) >= 4 && s[:4] == "YAKI": print("Yes") else: print("No");
s419776531
p03591
u937238023
1595469039
Python
Python (3.8.2)
py
Runtime Error
27
8956
79
s = input() if len(s)>=4 and s[:4] = "YAKI": print("Yes") else: print("No")
s373171411
p03591
u057993957
1594326940
Python
Python (3.8.2)
py
Runtime Error
24
9008
219
n, m, k = list(map(int, input().split())) flag = False for y in range(m+1): for x in range(n + 1): if n * y + m * x - 2 * x * y == k: flag = True break print("Yes" if flag else "No")
s638821121
p03591
u699089116
1593479128
Python
PyPy3 (7.3.0)
py
Runtime Error
88
74756
70
s = input() if s[:4] == "YAKI" print("Yes") else: print("No")
s196107617
p03591
u213580455
1590247332
Python
Python (3.4.3)
py
Runtime Error
17
3064
427
def answer(n, m, k): YES = 'Yes' NO = 'No' if k%n == 0 or k%m == 0: return YES j = 1 for i in range(m-1, 0, -1): a = (i + (n-1)*j) if k == a: return YES j += 1 j = 1 for i in range(n-1, 0, -1): a = (i + (m-1)*j) if k == a: ...
s544712590
p03591
u213580455
1590247018
Python
Python (3.4.3)
py
Runtime Error
18
3064
364
def answer(n, m, k): YES = 'Yes' NO = 'No' if k%n == 0 or k%m == 0: return YES j = 1 for i in range(m-1, 0, -1): a = (i + (n-1)*j) print(a) if k == a: return YES j += 1 if (n-2)*2 + (m-2)*2 == k: return YES return NO n, m, k = map(...
s004354557
p03591
u767995501
1589852709
Python
Python (3.4.3)
py
Runtime Error
18
2940
76
S = str(input()) if S[1:4] = 'YAKI' print('Yes') else: print('No')
s973955612
p03591
u767995501
1589852687
Python
Python (3.4.3)
py
Runtime Error
18
2940
69
S = str(input()) if S[1:4] = 'YAKI' print('Yes') else: print('No')
s525104116
p03591
u623687794
1589518238
Python
Python (3.4.3)
py
Runtime Error
18
3064
949
h,w=map(int,input().split()) a={} for i in range(26): a[chr(i+97)]=0 for i in range(h): s=input() for j in s: a[j]+=1 if h==1 and w==1:print("Yes") elif h==1 or w==1: cnt=0 for i in a.values(): if i%2==1:cnt+=1 if cnt!=1:print("No") else:print("Yes") elif h%2==0 and w%2==0: for i in a.values(): ...
s600857841
p03591
u849229491
1588777868
Python
Python (3.4.3)
py
Runtime Error
17
2940
117
s = list(str(input())) if s[0]=='Y' and s[1]=='A' and s[2]=='K' and s[3]=='I': print('Yes') else: print('No')
s239455788
p03591
u849229491
1588777802
Python
Python (3.4.3)
py
Runtime Error
18
2940
129
s = list(map(str,input().split())) if s[0]=='Y' and s[1]=='A' and s[2]=='K' and s[3]=='I': print('Yes') else: print('No')
s155887458
p03591
u652656291
1588531139
Python
Python (3.4.3)
py
Runtime Error
17
2940
65
s = input() if s[:4] = 'YAKI': print('Yes') else: print('No')
s488296429
p03591
u478888932
1586392672
Python
PyPy3 (2.4.0)
py
Runtime Error
177
38488
271
from sys import stdin n, m, k = map(int, stdin.readline().rstrip().split()) black = 0 for i in range(1, n+1): black = i * m for j in range(1, m+1): black += (n - (2 * i)) if black == k: print("Yes") quit() print("No")
s689914030
p03591
u276115223
1585966552
Python
Python (3.4.3)
py
Runtime Error
17
2940
162
# CODE FESTIVAL 2017 予選 A: A – Snuke's favorite YAKINIKU s = input() if len(s) < 4: print('No') else: print('Yes' if s.index('YAKI') == 0 else 'No')
s012754652
p03591
u276115223
1585966380
Python
Python (3.4.3)
py
Runtime Error
17
3064
137
# CODE FESTIVAL 2017 予選 A: A – Snuke's favorite YAKINIKU s = input() print('Yes' if len(s) >= 4 and s.index('YAKI') == 0 else 'No')
s136107243
p03591
u814986259
1583430491
Python
Python (3.4.3)
py
Runtime Error
17
3064
68
s=input() if s.startwith("YAKI"): print("Yes") else: print("No")
s441669459
p03591
u693933222
1582083234
Python
Python (3.4.3)
py
Runtime Error
17
2940
135
s = input() ans = 0 if (len(s) >= 4): if (s[0:4] == "YAKI"): ans = 1 if(ans == 1) print("Yes") else: print("No")
s739442714
p03591
u995062424
1581735765
Python
Python (3.4.3)
py
Runtime Error
17
2940
182
N, M, K = map(int, input().split()) for i in range(N+1): for j in range(M+1): if(i*(M-j)+(N-i)*j == K): print("Yes") quit() else: print("No")
s920166284
p03591
u987164499
1580538729
Python
Python (3.4.3)
py
Runtime Error
17
3056
239
from sys import stdin n,m,k = [int(x) for x in stdin.readline().rstrip().split()] for i in range(n+1): for j in range(m+1): kosuu = (n-j)*i+(m-i)*j if kosuu == k: print("Yes") exit() print("No")