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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s434289699 | p03722 | u926678805 | 1494726757 | Python | Python (3.4.3) | py | Runtime Error | 96 | 4476 | 645 | # coding: utf-8
n,m=map(int,input().split())
data=[]
dic={}
muki={}
kaburi=[]
kita={}
for i in range(1,n+1):
dic[i]=0
muki[i]=[(-1,0)]
kita[i]=0
for i in range(m):
a,b,c=map(int,input().split())
if (b,a) not in kaburi:
kaburi.append((a,b))
else:
print('inf')
exit()
if... |
s050930198 | p03722 | u332385682 | 1494726418 | Python | PyPy3 (2.4.0) | py | Runtime Error | 209 | 40304 | 842 | import sys
from collections import Counter
inf = 1<<60
def solve():
N, M = map(int, input().split())
edges = [None]*M
for i in range(M):
ui, vi, ci = map(int, sys.stdin.readline().split())
edges[i] = (ui-1, vi-1, -ci)
ans = Bellmanford(N, M, edges)
if ans is not None:
... |
s958287583 | p03722 | u846694620 | 1494726370 | Python | Python (3.4.3) | py | Runtime Error | 27 | 3956 | 1775 | import collections
import heapq
import math
class WeightedDigraph:
def __init__(self):
self.vertices = set()
self.successors = collections.defaultdict(list)
self.weights = {}
def add_vertex(self, label):
self.vertices.add(label)
def add_edge(self, begin, end, weight):
... |
s745114259 | p03722 | u226155577 | 1494725264 | Python | Python (2.7.6) | py | Runtime Error | 1137 | 3740 | 841 | n, m = map(int, raw_input().split())
g = [[] for i in xrange(n)]
for i in xrange(m):
a, b, c = map(int, raw_input().split())
g[a-1].append((b-1, c))
dist = [-10**18]*n
used = [0]*n
valid = [0]*n
memo = [None]*n
def dfs(v):
res = 0
if memo[v] is not None:
return memo[v]
for t, c in g[v]:
... |
s858447896 | p03722 | u226155577 | 1494725147 | Python | Python (2.7.6) | py | Runtime Error | 2104 | 3720 | 751 | n, m = map(int, raw_input().split())
g = [[] for i in xrange(n)]
for i in xrange(m):
a, b, c = map(int, raw_input().split())
g[a-1].append((b-1, c))
dist = [-10**18]*n
used = [0]*n
valid = [0]*n
def dfs(v):
res = 0
for t, c in g[v]:
if not used[t]:
if t == n-1:
res =... |
s863481315 | p03723 | u629540524 | 1601416270 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8884 | 171 | a,b,c=map(int,input().split())
if a==b==c and a%2==0:
print(-1)
d=0
else:
while a%2==0 and b%2==0 and c%2==0:
a,b,c=(b+c),(a+c),(a+b)
d+=1
print(d) |
s231652511 | p03723 | u845573105 | 1599105760 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9260 | 581 | A,B,C =map(int,input().split())
con = 0
if A % 2 == 1 or B % 2 == 1 or C % 1 == 1:
print(0)
exit()
if A == B and B == C:
print(-1)
exit()
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
con += 1
D = A / 2
E = B / 2
F = C / 2
A = E + F
B = D + F
C = D + E
print(con)
A,B,C =map(int,input().split(... |
s636337068 | p03723 | u845573105 | 1599105699 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9280 | 594 | A,B,C =map(int,input().split())
con = 0
if A % 2 == 1 or B % 2 == 1 or C % 1 == 1:
print(0)
exit()
if A == B and B == C:
print(-1)
exit()
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
con += 1
D = A / 2
E = B / 2
F = C / 2
A = E + F
B = D + F
C = D + E
print(con)
A,B,C =map(int,input().split(... |
s188265554 | p03723 | u845573105 | 1599105517 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9056 | 238 | A,B,C =map(int,input().split())
con = 0
if A == B and B == C:
print(-1)
exit()
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
break
con += 1
D = A / 2
E = B / 2
F = C / 2
A = E + F
B = D + F
C = D + E
print(con) |
s792630338 | p03723 | u796563423 | 1598721113 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8952 | 269 | a,b,c=map(int,input().split())
if a==b==c:
print(-1)
total=0
else:
while True:
x=a/2
y=b/2
z=c/2
a=y+z
b=x+z
c=x+y
total+=1
if a%2!=0 or b%2!=0 or c%2!=0:
print(total)
break |
s109341926 | p03723 | u457601965 | 1598144577 | Python | Python (3.8.2) | py | Runtime Error | 2016 | 127996 | 470 | import sys
import numpy as np
import numba
from numba import jit
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
@jit
def main(p):
count = 0
if np.any(p%2==1):
return 0
if np.unique(p).size == 1:
return -1
while True:
if np.all(p%2 == 0):
... |
s022098372 | p03723 | u813174766 | 1597459302 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8940 | 161 | def(a,b,c):
if a%2+b%2+c%2>0:
return 0
if a==b==c:
return -1
return f((b+c)//2,(c+a)//2,(a+b)//2)+1
a,b,c=map(int,input().split())
print(f(a,b,c)) |
s256916739 | p03723 | u478417863 | 1596651859 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9100 | 268 | if a%2==1 or b%2==1 or c%2==1:
print(f)
elif a==b and b==c:
f=-1
print(f)
else:
while a%2==0 and b%2==0 and c%2==0:
A=a
B=b
C=c
a=B//2+C//2
b=A//2+C//2
c=A//2+B//2
f=f+1
else:
print(f) |
s550672770 | p03723 | u562015767 | 1596075873 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9176 | 236 | a,b,c = map(int,input().split())
cnt = 0
if a == b and a== c and a%2 == 0:
print(-1)
exit()
while acnt%2 == 0 and bcnt%2 == 0 and ccnt%2 == 0:
cnt+=1
i=a
j=b
a=(b+c)//2
b=(i+c)//2
c=(i+j)//2
print(cnt) |
s554773680 | p03723 | u830881690 | 1595892259 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9176 | 383 | a,b,c=map(int,open(0).read().split())
if a==b==c and a%2==0:
print(-1)
else:
num=0
while true:
if a%2==1 or b%2==1 or c%2==1:
break
else:
l=[(b+c)/2,(c+a)/2,(a+b)/2]
num+=1
l=[(l[1]+l[2])/2, (l[2]+l[0])/2, (l[0]+l[2])/2]
a=l[0]
... |
s954582621 | p03723 | u830881690 | 1595892134 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9112 | 359 | a,b,c=map(int,open(0).read().split())
if a==b==c and a%2==0:
print(-1)
else:
num=0
while true:
if a%2==1 or b%2==1 or c%2==1:
break
else:
l=[(b+c)/2,(c+a)/2,(a+b)/2]
num+=1
l=[(l[1]+l[2])/2, (l[2]+l[0])/2, (l[0]+l[2])/2]
a,b,c=l[0]... |
s670972191 | p03723 | u430928274 | 1594530079 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8892 | 412 | a, b, c = map(int, input().split())
a_tmp = a ; b_tmp = b ; c_tmp = c
count = 0
while True :
count += 1
a = b_tmp/2 + c_tmp/2
b = a_tmp/2 + c_tmp/2
c = a_tmp/2 + b_tmp/2
if a == a_tmp and b == b_tmp and c = c_tmp :
print("-1")
break
a_tmp = a ; b_tmp = b ; c_tmp = c
if a%2 ==... |
s270394382 | p03723 | u430928274 | 1594530025 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9012 | 412 | a, b, c = map(int, input().split())
a_tmp = a ; b_tmp = b ; c_tmp = c
count = 0
while True :
count += 1
a = b_tmp/2 + c_tmp/2
b = a_tmp/2 + c_tmp/2
c = a_tmp/2 + b_tmp/2
if a == a_tmp and b == b_tmp and c = c_tmp :
print("-1")
break
a_tmp = a ; b_tmp = b ; c_tmp = c
if a%2 ==... |
s796750335 | p03723 | u173025122 | 1594230339 | Python | PyPy3 (7.3.0) | py | Runtime Error | 291 | 74576 | 1 | a |
s246006457 | p03723 | u173025122 | 1594229622 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74816 | 1 | a |
s468472502 | p03723 | u113107956 | 1593649843 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8852 | 228 | a,b,c=map(int,input().split())
if a==b==c:
if a%2===b%2==c%2==0:
print(-1)
else:
print(0)
exit()
cnt=0
while a%2==b%2==c%2:
A=a//2
B=b//2
C=c//2
a,b,c=B+C,A+C,A+B
cnt+=1
print(cnt) |
s245609826 | p03723 | u968404618 | 1593485145 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8944 | 229 | a, b, c = map(int, input().split())
if a == b == c:
print(-1)
exit()
if a%2!=0 or b%2!=0 or c%2!=0:
print(0)
exit()
N = (a+b+c)//3
cnt = 1
while N:
if N%2 != 0: break
N //= 2
cnt += 1
print(cnt) |
s214201313 | p03723 | u576335153 | 1592634107 | Python | Python (3.8.2) | py | Runtime Error | 1353 | 127540 | 538 | import time
start = time.time()
a, b, c = map(int, input().split())
cnt = 0
a_list = [0]*(1001001)
b_list = [0]*(1001001)
c_list = [0]*(1001001)
a_list[0] = a
b_list[0] = b
c_list[0] = c
for i in range(1, 10**9):
a_list[i] = (b_list[i-1] + c_list[i-1]) // 2
b_list[i] = (c_list[i-1] + a_list[i-1]) // 2
c_l... |
s197393797 | p03723 | u576335153 | 1592634037 | Python | Python (3.8.2) | py | Runtime Error | 1110 | 118120 | 536 | import time
start = time.time()
a, b, c = map(int, input().split())
cnt = 0
a_list = [0]*(1001001)
b_list = [0]*(1001001)
c_list = [0]*(1001001)
a_list[0] = a
b_list[0] = b
c_list[0] = c
for i in range(1, 10**9):
a_list[i] = (b_list[i-1] + c_list[i-1]) // 2
b_list[i] = (c_list[i-1] + a_list[i-1]) // 2
c_l... |
s523693789 | p03723 | u441246928 | 1592274427 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 295 | A,B,C = list(map(int,input().split()))
if A == B == C and A%2 == 0 :
print(-1)
elif A == B == C and A%2 == 1 :
print(0)
else :
cnt=0
while a%2==b%2==c%2==0:
total=a+b+c
a=total//2-a//2
b=total//2-b//2
c=total//2-c//2
cnt+=1
print(cnt)
|
s410246230 | p03723 | u004676431 | 1592152369 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 391 | //It will be infinite if all of them have a power of 2
//otherwise someone has to give out and odd number
//If all of them are equal then -1
from math import log
a,b,c=list(map(int,input().split()))
if a==b and b==c and c==a:
print('-1')
n=0
while a%2==0 and b%2==0 and c%2==0:
temp_a = c/2+b/2
temp_b = a/2+c/2
... |
s776017882 | p03723 | u285891772 | 1592095458 | Python | Python (3.4.3) | py | Runtime Error | 39 | 5204 | 1091 | import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees#, log2
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mu... |
s738887373 | p03723 | u587589241 | 1592062291 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 275 | a,b,c=map(int,input().split())
ans=0
if a%2==1 or b%2==1 or c%2==1:
print(-1)
sys.exit()
if a%2==0 and a==b==c:
print(-1)
sys.exit()
while a%2==0 and b%2==0 and c%2==0:
ta=a/2
tb=b/2
tc=c/2
a=tb+tc
b=ta+tc
c=ta+tb
ans+=1
print(ans) |
s835559822 | p03723 | u587589241 | 1592062271 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 115 | import sys
n=int(input())
if n==1:
print(1)
sys.exit()
k=2
ans=0
while k*2<=n:
k*=2
ans+=1
print(k) |
s716036624 | p03723 | u474925961 | 1591900510 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 219 | a,b,c=map(int,input().split())
if a==b==c:
print(-1)
else:
cnt=0
while a%2==b%2==c%2==0:
total=a+b+c
a=total//2-a//2
b=total//2-b//2
c=total//2-c//2
cnt+=1
print(cnt) |
s067337224 | p03723 | u106181248 | 1591718756 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 270 | a, b, c = map(int,input().split())
ans = 0
if a == b == c and a%2 == 0:
print(-1) #無限
exit()
while x%2 == 0 and y%2 == 0 and z%2 == 0:
ans += 1
x = b//2 + c//2
y = a//2 + c//2
z = a//2 + b//2
a = x
b = y
c = z
print(ans)
|
s115925710 | p03723 | u106181248 | 1591718650 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 274 | a, b, c = map(int,input().split())
ans = 0
if a == b == c and a%2 == 0:
print(-1) #無限
exit()
while x%2 == 0 and y%2 == 0 and z%2 == 1:
ans += 1
x = b//2 + c//2
y = a//2 + c//2
z = a//2 + b//2
a = x
b = y
c = z
print(ans)
|
s855203100 | p03723 | u467307100 | 1591474560 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 194 | a,b,c = map(int,input().split())
count = 0
for i in range(600):
if a == b and b == c:
break
a,b,c = a//2, b//2, c//2
a, b, c = b + c, a + c, a + b
ans = i if i < 600 else -1
print(-1 |
s722350702 | p03723 | u745514010 | 1591324642 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 225 | a, b, c = map(int(input().split()))
ans = 0
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
if a == b == c:
print(-1)
exit()
a, b, c = (b + c) // 2, (c + a) // 2, (a + b) // 2
ans += 1
print(ans)
|
s831035036 | p03723 | u408620326 | 1590775774 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 187 | A, B, C = map(int, input().strip().split())
ans = 0
while A != B and B != C and (A % 2) + (B % 2) + (C % 2) == 0:
A, B, C = (B + C) // 2, (A, C) // 2, (A + B) // 2
ans += 1
print(ans) |
s424739905 | p03723 | u094999522 | 1590687383 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 137 | *a, = map(int, input().split())
a = [bin(abs(a[i+1]-a[i]))[::-1].find('1') for i in range(2)].sort()
print(a[1] if a[0]*a[1]<0 else a[0]) |
s400956895 | p03723 | u227085629 | 1590673078 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 258 | a,b,c = map(int,input().split())
if a == b == c:
if a%2 == b%2 == c%2 == 0:
print(-1)
else:
print(0)
t = 0
else:
while t > -1:
if a%2 == 1 or b%2 == 1 or c%2 == 1:
break
(a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2)
t += 1
print(t) |
s755318322 | p03723 | u227085629 | 1590672965 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 240 | a,b,c = map(int,input().split())
if a == b == c:
if a%2 == b%2 == c%2 == 0:
prnit(-1)
else:
print(0)
t = 0
while t > -1:
if a%2 == 1 or b%2 == 1 or c%2 == 1:
break
(a,b,c) = ((b+c)//2,(a+c)//2,(a+b)//2)
t += 1
print(t) |
s430038631 | p03723 | u994935583 | 1590639271 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 459 | def resolve():
A,B,C = map(int,input().split())
count = 0
if A == C and A == B:
if A % 2 == 1:
print(0)
else:
print(-1)
else:
while (A % 2 == 0 and B % 2 == 0 and C % 2 == 0):
tmpA = (B + C) / 2
tmpB = (A + C) / 2
tmpC... |
s787358010 | p03723 | u713914478 | 1590604336 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 375 | A,B,C = map(int, input().split())
def even(a):
if a % 2 == 0:
return True
else:
return False
if A == B and B == C:
print("-1")
elif:
if not (even(A) and even(B) and even(C)):
print("0")
else:
cnt = 0
while even(A) and even(B) and even(C):
tmp1, tmp2, tmp3 = A,B,C
A = (tmp2+tmp3) // 2
B = (tmp3+tm... |
s861805508 | p03723 | u314089899 | 1590540486 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 550 | 5 5 3
2.5+1.5 2.5+1.5 2.5+2.5
4 4 5
A,B,C = map(int, input().split())
base = min(A,B,C)
A -= base
B -= base
C -= base
def dibidable_by_two(N):
ans = 0
if N ==0:
return 0
else:
while 1:
if N%2 !=0:
return ans
else:
N /= 2
... |
s173926574 | p03723 | u417096287 | 1590158784 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38512 | 371 | import sys
A, B, C = map(int, input().split())
ans = 0
if A == B == C:
print(-1)
sys.exit()
while True:
if A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
t_A, t_B, t_C = A, B, C
A = (t_B + t_C) // 2
B = (t_C + t_A) // 2
C = (t_A + t_B) // 2
print(f"{A} {B} {C}")
... |
s387392027 | p03723 | u228232845 | 1590109922 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 798 | import sys
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
... |
s311638411 | p03723 | u476124554 | 1589891478 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38640 | 382 | a,b,c = map(int,input().split())
if a == b and b == c and c == a:
print(-1)
else:
for i in range(10**9):
ans = i
if a % 2 ==1:
break
else:
a = b/2 + c/2
if b % 2 == 1:
break
else:
b = c/2 + a/2
if c % 2 == 1:
... |
s081672693 | p03723 | u075595666 | 1589854106 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 196 | n,m = map(int,input().split())
chk = [0]*n
for i in range(m):
a,b = map(int,input().split())
chk[a-1] += 1
chk[b-1] += 1
ans = 'YES'
for i in chk:
if i % 2 == 1:
ans = 'NO'
print(ans) |
s360341365 | p03723 | u357949405 | 1589337295 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 214 | A, B, C = map(int, input().split())
if A == B == C:
print(-1)
else:
count = 0
while 0 == A % 2 == B % 2 == C % 2:
A = (B + C) // 2
B = (C + A) // 2
C = (A + B) // 2
count += 1
print(count)
|
s112424583 | p03723 | u215341636 | 1589036072 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 368 | a , b , c = map(int, input().split())
count = 0
if a == 1 and b == 1 and c == 1:
break
elif a == b and a == c:
count = -1
else:
while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
a_copy = a
b_copy = b
c_copy = c
a = int(b_copy / 2 + c_copy / 2)
b = int(a_copy / 2 + c_copy / 2)
c = int(b_copy ... |
s764963417 | p03723 | u711238850 | 1588927799 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38384 | 283 | a,b,c = tuple(map(int,input().split()))
if len(set((a,b,c)))<3:
print(-1)
else:
ans = 0
while True:
if a%2==0 and b%2==0 and c%2==0:
a,b,c == b//2+c//2,c//2+a//2,a//2+b//2
ans+=1
else:
break
if len(set((a,b,c)))<3:
print(-1)
print(ans)
|
s110422379 | p03723 | u711238850 | 1588927493 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38256 | 232 | a,b,c = tuple(map(int,input().split()))
if a==b and b==c:
print(-1)
ans = 0
else:
while True:
if a%2==0 and b%2==0 and c%2==0:
a,b,c == b//2+c//2,c//2+a//2,a//2+b//2
ans+=1
else:
break
print(ans) |
s384322936 | p03723 | u234189749 | 1588708881 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 250 | A,B,C = map(int,input().split())
ans = 0
while (A%2 == 0) & (B%2 == 0) & (C%2 == 0):
if (A==B) & (B==C) :
ans = -1
break
a = (B+C)/2
b = (A+C)/2
c = (A+B)/2
A = a
B = b
C = c
ans += 1
print(ans) |
s579662809 | p03723 | u103902792 | 1588289430 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 251 | a,b,c = map(int,input().split())
if a%2 or b%2 or c%2:
print(0)
exit()
elif a==b==c:
print(-1)
exit()
ans =0
while 1:
if all(a%2==0, b%2==0, c%2==0):
ans += 1
else:
print(ans)
exit()
a, b, c = (b+c)//2, (a+c)//2, (b+a)//2 |
s254696268 | p03723 | u593567568 | 1587842111 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 255 | A,B,C = map(int,input().split())
ans = None
if A == B and B == C:
print(-1)
exit()
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
ans += 1
if A == B and B == C:
print(-1)
exit()
print(ans)
|
s703310449 | p03723 | u593567568 | 1587842078 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 242 | A,B,C = int(input())
ans = None
if A == B and B == C:
print(-1)
exit()
while A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
A,B,C = (B+C)//2,(C+A)//2,(A+B)//2
ans += 1
if A == B and B == C:
print(-1)
exit()
print(ans) |
s923412157 | p03723 | u211236379 | 1587665288 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 278 | if A==B==C:
print(-1)
else:
for i in range(100000000):
if A %2==0 and B%2==0 and C%2==0:
a = A/2
b = B/2
c = C/2
A = b+c
B = a+c
C = a+b
else:
print(i)
exit() |
s122974005 | p03723 | u858670323 | 1587078530 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 252 | a,b,c=map(int,input().rstrip().split(' '))
if(a==b and b==c):
if(a%2==0):
print(-1)
else:
print(0)
else:
n=0
while(a%2==0 and b%2==0 and c%2==0):
n+=1
tmp_a=(b+c)/2
tmp_b=(a+c)/2
tmp_c=(b+a)/2
a=tmp_a
b=tmp_b
c=tmp_c
print(n)
|
s659713394 | p03723 | u858670323 | 1587078078 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | a,b,c=map(int,input())
if(a==b and b==c):
print(-1)
else:
n=0
while(a%2==0 and b%2==0 and c%2==0):
n+=1
a=(b+c)/2
b=(a+c)/2
c=(b+a)/2
print(n)
|
s365414533 | p03723 | u368796742 | 1587052583 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 351 | l = list(map(int,input().split()))
count = 0
while True:
if l[0] == l[1] == l[2]:
if l[1]%2 == 0:
print(-1)
exit(9)
for i in range(3):
if l[i]%2 == 1:
print(count)
exit()
count += 1
l[0],l[1],l[2] = (l[1]+l[2])//2,(l[0]+l[2])//2,(l[1]+l[0])... |
s810396436 | p03723 | u085530099 | 1586954688 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 438 | count = 0
x = input()
t = x[0]
a = x[1]
s = x[2]
while True:
t = int(t) / 2
a = int(a) / 2
s = int(s) / 2
count += 1
print(count)
t_amari = int(t) % 2
a_amari = int(a) % 2
s_amari = int(s) % 2
if t_amari != 0:
break
if a_amari != 0:
break
if s_amari != 0:
break
if a == t+1 and s == ... |
s873495027 | p03723 | u152614052 | 1586832554 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 341 | a,b,c = map(int,input().split())
cnt=0
if a==b==c and a%2==0:
cnt = -1
break
elif:
for i in range(100):
if a%2==0 and b%2==0 and c%2==10:
t_a = b//2 + c//2
t_b = a//2 + c//2
t_c = a//2 + b//2
a,b,c = t_a,t_b,t_c
cnt+=1
else:
... |
s756466612 | p03723 | u274635633 | 1586808151 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 245 | a,b,c=map(input().split())
if a==b==c:
print(-1)
elif a%2==1 or b%2==1 or c%2==1:
print(0)
else:
ans=0
while a%2==0 and b%2==0 and c%2==0:
ans+=1
a1=(b+c)//2
b1=(c+a)//2
c1=(a+b)//2
a=a1
b=b1
c=c1
print(ans) |
s792739251 | p03723 | u274635633 | 1586808134 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 243 | a,b,c=map(input().split())
if a==b==c:
print(-1)
elif a%2==1 or b%2==1 or c%2==1:
print(0)
else:
ans=0
while a%2==0 and b%2==0 and c%2==0:
ans+=1
a1=(b+c)//2
b1=(c+a)//2
c1=(a+b)//2
a=a1
b=b1
c=c1
print(ans) |
s921389661 | p03723 | u933341648 | 1586799859 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 288 | a, b, c = map(int, input().split())
if a%2==0 and b%2==0 and c%2==0 and a==b==c:
print(-1)
else:
res = 0
while True:
if a%2==1 or b%2==1 or c%2==1:
break
else:
a, b, c = b//2+c//2, a//2+c//2, a//2+b//2
res += 1
print(res)
|
s879118307 | p03723 | u201928947 | 1586781095 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 350 | from time import time
t = time()
count = 0
a = int(input())
b = int(input())
c = int(input())
while True:
if a % 2 != 0 or b % 2 != 0 or c % 2 != 0:
print(count)
exit()
count += 1
a1 = b//2+c//2
b1 = c//2+a//2
c1 = a//2+b//2
a = a1
b = b1
c = c1
if time()-t >= 1.8:
... |
s246619192 | p03723 | u105124953 | 1586725008 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 253 | import sys
a,b,c = map(int,input().split())
if a == b == c:
print(-1)
sys.eixt()
count = 0
while a%2 == 0 and b%2 == 0 and c%2 == 0:
x = (b+c)//2
y = (a+c)//2
z = (a+b)//2
a,b,c = x,y,z
count+=1
#print(a,b,c)
print(count) |
s398589505 | p03723 | u751843916 | 1584769115 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 344 | s=list(input().split())
n=int(input())
t=[input() for i in range(n)]
r=[]
for x in s:
for y in t:
if len(x)==len(y):
l=list(x)
for z in range(len(x)):
if y[z]=="*":l[z]="*"
if "".join(l)==y:
r.append("*"*len(x))
break
el... |
s017913654 | p03723 | u022979415 | 1584586774 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3572 | 337 | from functools import reduce
from math import gcd
def main():
cookies = list(map(int, input().split()))
answer = -1
if cookies[0] % 2 or cookies[1] % 2 or cookies[2] % 2:
answer = 0
elif len(set(cookies)) > 1:
answer = reduce(gcd, cookies) - 1
print(answer)
if __name__ == '__main... |
s629172112 | p03723 | u672475305 | 1583623740 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 487 | a,b,c = map(int,input().split())
lst = [a,b,c]
lst.sort()
res = True
if a==b-=c:
print(-1)
else:
while True:
if a%2!=0 or b%2!=0 or c%2!=0:
break
else:
res += 1
nx_a = b//2 + c//2
nx_b = a//2 + c//2
nx_c = a//2 + b//2
tmp = ... |
s676608151 | p03723 | u644907318 | 1578075878 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 375 | A,B,C = map(int,input().split())
if A%2==1 or B%2==1 or C%2==1:
cnt = 0
elif A==B and A==C:
cnt = -1
else:
a = 0
while A%2==0:
A //= 2
a += 1
b = 0
while B%2==0:
B //= 2
b += 1
c = 0
while C%2==0:
C //= 2
c += 1
cnt = min(a,b,c)
if [a,b... |
s067388177 | p03723 | u252828980 | 1576117940 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 253 | a,b,c = map(int,input().split())
if any((a%2==1,b%2!==1,c%2==1)):
print(0)
exit()
cnt = 0
while cnt <= 100:
a,b,c = (b+c)/2, (a+c)/2,(a+b)/2
cnt += 1
if any((a%1!=0,b%1!=0,c%1!=0)):
print(cnt-1)
exit()
print(-1) |
s185526484 | p03723 | u727787724 | 1574160883 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 620 | a,b,c=map(int,input().split())
if a==b and b==c:
print(-1)
elif if a%2!=0 or b%2!=0 or c%2!=0:
print(0)
else:
a1=0
a2=0
a3=0
c1=0
c2=0
c3=0
ans=0
for i in range(200000):
if a%2!=0:
c1=1
if b%2!=0:
c2=1
if c%2!=0:
... |
s196006392 | p03723 | u740284863 | 1571462311 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 367 | a,b,c = map(int,input().split())
if a == b and b == c:
print(-1)
else:
ans = 0
while True:
if a % 2 == 0 and b % 2 -= 0 and c % 2 == 0:
ans += 1
A = b / 2 + c / 2
B = c / 2 + a / 2
C = a / 2 + b / 2
a = A
b = B
c = C... |
s224782324 | p03723 | u785578220 | 1565708002 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 350 | a = input()
b = int(a)
s = (9-len(a))*'0'+a
ans = 0
for i in range(9):
if s[i] == '0' and ans==0:
continue
ans+=(b//((10**(8-i))*10))*(10**(8-i))
c = (b%((10**(8-i))*10))+1
#print(0,c)
if 2*(10**(8-i))>= c > 10**(8-i):
ans+=c-10**(8-i)
elif c>=2*10**((8-i)):
ans+=10**(8-... |
s747142422 | p03723 | u177756077 | 1564524062 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 275 | # 誰か奇数になったら終了
# A==B==C になったら-1
A,B,C=map(int,input().split())
cnt=0
while A%2==0 and B%2==0 and C%2==0:
if A==B==C:
ans=-1
break
else:
A,B,C=(B+C)//2,(C+A)//2,(A+B)//2
cnt+=1
ans=cnt
print(ans) |
s052534789 | p03723 | u399721252 | 1563900833 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38256 | 347 |
a, b, c = [ int(v) for v in input().split() ]
if all([a==b,b==c]):
print(-1)
else:
t = 0
while:
a, b, c = map( int,[ b/2+c/2, c/2+a/2, a/2+b/2 ] )
t += 1
if not all([a%2==0,b%2==0,c%2==0]):
print(t)
break
if all([a==b,b==c]):
print(-1)... |
s555396854 | p03723 | u405256066 | 1563521485 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 509 | from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
def factorize(n):
fct = [] # prime factor
b, e = 2, 0 # base, exponent
while b * b <= n:
while n % b == 0:
n = n // b
e = e + 1
if e > 0:
fct.append((b, e))
b, e = ... |
s348185517 | p03723 | u427344224 | 1563061873 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2118 | 2057160 | 1360 | H, W, K = map(int, input().split())
items = []
start = []
diff = float("inf")
p = []
prev = [[False] * W for _ in range(H)]
for i in range(H):
items.append(list(input()))
for j in range(W):
s = items[i][j]
if s == "S":
start = [i, j]
diff = min(diff, min(i, H - 1 - i, mi... |
s298636871 | p03723 | u504562455 | 1562105688 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 369 | a, b, c = [int(i) for i in input().split()]
if x%2 == 1 or y%2 == 1 or z%2 == 1:
print(0)
elif a == b and b == c:
print(-1)
else:
x = a
y = b
z = c
cnt = 0
while True:
if x%2 == 1 or y%2 == 1 or z%2 == 1:
break
else:
x, y, z = y//2 + z//2, x//2 + z//2,... |
s708325959 | p03723 | u899975427 | 1560975978 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 280 | a,b,c = map(int,input().split())
if a == b == c:
if a%2 = 0:
print(-1)
exit()
else:
print(0)
exit()
ans = 0
while(a%2 == b%2 == c%2 == 0):
temp_a = (b+c)//2
temp_b = (a+c)//2
temp_c = (b+a)//2
ans += 1
a = temp_a
b = temp_b
c = temp_c
print(ans) |
s430882030 | p03723 | u463655976 | 1560613188 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 260 | A, B, C = map(int, input().split())
if any([A % 2, B % 2, C % 2]):
print(0)
exit()
if A == B == C:
print(-1)
exit()
count = 0
while all([A % 2 == 0, B % 2 == 0, C % 2 == 0]):
A, B, C = ((B+C)//2, (A+C)//2, (A+B)//2)
count += 1
print(count)
|
s833722238 | p03723 | u223904637 | 1560117332 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 251 | a,b,c=map(int,input().split())
if a==b and b==c and a%2=0:
print(-1)
else:
ans=0
while a%2==0 ans b%2==0 and c%2==0:
tmp=a
tmp2=b
a=(b+c)//2
b=(c+tmp)//2
c=(tmp+tmp2)//2
ans+=1
print(ans) |
s873897052 | p03723 | u127844950 | 1558491071 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 23 | import hogehugapoyopoyo |
s542013238 | p03723 | u634461820 | 1553282533 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 259 | A,B,C = list(map(int,input().split()))
if A == B and A == C:
print(-1)
exit(
else:
cnt = 0
while True:
if A%2==0 and B%2==0 and C%2==0:
A,B,C = (B+C)//2,(A+C)//2,(A+B)//2
cnt += 1
continue
else:
break
print(cnt) |
s550322481 | p03723 | u543954314 | 1553215265 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 179 | import math
n = list(map(int, input().split()))
d = max(m)-min(m)
if d:
cnt = 0
while d%2 == 0:
d //= 2
cnt += 1
print(cnt)
elif n[0]%2:
print(0)
else:
print(-1) |
s914528138 | p03723 | u950708010 | 1552075353 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 315 | def solve():
n,m = (int(i) for i in input().split())
a = [0]*n
for i in range(m):
a1,b1 = (int(i) for i in input().split())
a[a1-1]+=1
a[b1-1]+=1
ans = 'YES'
for i in range(1,n+1):
if a[i]%2 == 1:
ans ='NO'
return ans
if __name__ == '__main__':
print(solve()) |
s829323372 | p03723 | u280512618 | 1552074249 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4096 | 304 | def solve(a, b, c):
if (a, b, c) in s:
return -1
if (a % 2) or (b % 2) or (c % 2):
return 0
a >>= 1
b >>= 1
c >>= 1
return 1 + solve(b + c , c + a, a + b)
if __name__ == '__main__':
a, b, c = map(int, input().split())
s = set()
print(solve(a, b, c))
|
s303134811 | p03723 | u766684188 | 1551929521 | Python | Python (3.4.3) | py | Runtime Error | 2132 | 2027500 | 855 | import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**9)
from collections import deque
from math import ceil
def dist(h,w,x,y):
return min(x-1,h-x,y-1,w-y)
h,w,k=map(int,input().split())
MAP=[]
A=['#']*(w+2)
MAP.append(A)
for i in range(h):
s='#'+input().strip()+'#'
for j,t in enumerate(s):
... |
s349423248 | p03723 | u619819312 | 1550357152 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 270 | a,b,c=map(int,input().split())
if a%4!=0 and b%4!=0 and c%4!=0 or(a==b and b==c):
print(-1)
else:
s=a+b+c
d=0
j=0
while a%2!=1 and b%2!=1 and c%2!=1:
d+=1
h=s
j=a
a=(s-a)//2
b=j//2+c//2
c=h-a-b
print(d) |
s472875713 | p03723 | u375616706 | 1548957578 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 479 | def log_2(n):
t = 0
while n:
if n % 2 == 1:
break
t += 1
n //= 2
return t
def solve(A, B, C)->int:
s = A+B+C
odd = log_2(s-C)
even = log_2(s+A)
if odd == even:
return odd
else:
return odd+1
A, B, C = map(int, input().split())
A, B... |
s537397390 | p03723 | u785578220 | 1547872378 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 228 | a = lma()
f = 1
c =0
while f:
if (a[0] == a[1] and a[0] == a[2]) :
c=-1
break
if a[0]%2==1 or a[1]%2==1 or a[2]%2 ==1:break
a[0],a[1],a[2] = (a[1]+a[2])/2,(a[0]+a[2])/2,(a[1]+a[0])/2
c+=1
print(c) |
s707626020 | p03723 | u102960641 | 1547156289 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 224 | a,b,c = map(int, input().split())
d,e,f = abs(b-a),abs(c-b),abs(a-c)
ans = 0
if d == e and e == f:
print(-1)
else:
while d % 2 == 0 and e % 2 == 0 f % 2 == 0:
ans += 1
d //= 2
e //= 2
f //= 2
print(ans) |
s329582828 | p03723 | u102960641 | 1547156258 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 234 | a,b,c = map(int, input().split())
d,e,f = abs(b-a),abs(c-b),abs(a-c)
if d == e and e == f:
print(-1)
ans = 0
else:
while d % 2 == 0 and e % 2 == 0 f % 2 == 0:
ans += 1
d //= 2
e //= 2
f //= 2
else:
print(ans) |
s316645306 | p03723 | u075012704 | 1522099794 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 363 | A, B, C = map(int, input().split())
if A == B == C and all(lambda x: x%2==0, [A, B, C]):
print(-1)
else:
ans = 0
cookie = A+B+C
while True:
if all(map(lambda x: x%2==0, [A, B, C])):
ans += 1
else:
print(ans)
break
A = (cookie-A) / 2
B ... |
s328094986 | p03723 | u793158002 | 1504184533 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 148 | import math
a, b, c = raw_input().split()
a = int(a)
b = int(b)
c = int(c)
mx = max(max(a, b), c)
print (int(math.log(float(mx)) / math.log(2)) - 1) |
s234146054 | p03723 | u961160262 | 1494708561 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 335 | def isOdd(num):
if num % 2 == 0:
return False
else:
return True
A, B, C = map(int, raw_input().split())
ans = 0
while not isOdd(A) and not isOdd(B) and not isOdd(C):
ans += 1
new1, new2, new3 = B/2 + C/2, A/2 + C/2, A/2 + B/2
if set(A, B, C) == set(new1, new2, new3):
print -1
else:
A, B, C = new1, new2, ... |
s467676979 | p03723 | u629562404 | 1494538750 | Python | PyPy2 (5.6.0) | py | Runtime Error | 36 | 27884 | 531 | import pdb
a,b,c = map(int, raw_input().strip().split(' '))
if a==b==c:
if a%2==0:
print '-1'
else
print '0'
elif a%2!=0 or b%2!=0 or c%2!=0:
print '0'
else:
Flag = True
cnt = 0
for i in range(100000):
tmp1,tmp2=a,b
a = b/2+c/2
b = tmp1/2+c/2
c = t... |
s943851255 | p03723 | u373745856 | 1494126516 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 328 | n = int(input())
p2 = [ int(i) for i in input().split() ]
ps = sorted(p2)
cnt=0
while True:
if p2 == ps: break
cnt += 1
high = []
low = []
for i in range(len(p2)):
if p2[i] == max(p2[0:i+1]):
high.append(p2[i])
else:
low.append(p2[i])
p2 = low + high
pri... |
s363832071 | p03723 | u992088972 | 1494125736 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 328 | # coding: utf-8
a, b, c = map(int, input().rstrip().split())
count = 0
while True:
elif a == b and b == c and c == a :
count = -1 if a % 2 == 1 else 0
break
if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 :
a, b, c = (b+c)/2, (c+a)/2, (a+b)/2
count += 1
else:
break
prin... |
s488906732 | p03723 | u992088972 | 1494125650 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 328 | # coding: utf-8
a, b, c = map(int, input().rstrip().split())
count = 0
while True:
elif a == b and b == c and c == a :
count = -1 if a % 2 == 1 else 0
break
if a % 2 == 0 and b % 2 == 0 and c % 2 == 0 :
a, b, c = (b+c)/2, (c+a)/2, (a+b)/2
count += 1
else:
break
prin... |
s601514333 | p03723 | u872191059 | 1494124260 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38640 | 784 | def dist(r, c):
return min(r, H - r - 1, c, W - c - 1)
H, W, K = map(int, input().split())
A = [list(input()) for _ in range(H)]
for r in range(H):
for c in range(W):
if A[r][c] == 'S':
sr = r
sc = c
dxy = [(1, 0), (0, -1), (-1, 0), (0, 1)]
pos = [(sr, sc)]
dic = {(sr, sc): K}... |
s508284002 | p03723 | u667084803 | 1494124004 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 416 | import sys
# 整数の入力
N,M=list(map(int, input().split()))
p=[]
q=0
count=0
for i in range(0,M):
p.append(list(map(int, input().split())))
for i in range(0,M):
q+=p[i][0]-p[i][1]
if q%2==1:
print("NO")
else:
m=int(M/100)
for j in range(0,M,m):
for i in range(0,M):
if p[i][0]==j or p[i][1]==j:
co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.