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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s077919960 | p03580 | u846372029 | 1507516024 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 5528 | 593 | # D - 101 to 010
n = int(input())
s = input()
ss = s
ss.find("1011")
"1011" in ss
cnt=0
while "1011" in ss:
#print(ss)
i = ss.find("1011")
j = i+2
while ss[j]=="1" and j<n:
#print(j)
j+=1
cnt+=j-i-2
ss = ss[:i] + "0"*(j-i-3)+"010" + ss[j:]
#ss = s
#cnt=0
while "101" in ss:
... |
s740726359 | p03580 | u751663243 | 1507515409 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 489372 | 906 | N = map(int,input())
S = input()
dic = {}
def solve(S):
if len(S)<3:
return 0
if len(S) == 3:
if S == '101':
return 1
else:
return 0
if S in dic:
return dic[S]
for i in range(len(S)):
if S[i] == '1':
break
for j in range(i,l... |
s198501189 | p03580 | u751663243 | 1507514495 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 489452 | 702 | N = map(int,input())
S = input()
dic = {}
def solve(S):
if len(S)<3:
return 0
if len(S) == 3:
if S == '101':
return 1
else:
return 0
if S in dic:
return dic[S]
for i in range(len(S)):
if S[i] == '1':
break
for j in range(i,l... |
s983404289 | p03580 | u916943847 | 1507512378 | Python | Python (3.4.3) | py | Runtime Error | 2082 | 492532 | 168 | def count_ops(s, ops = 0):
if "101" in s:
return count_ops(s.replace("101", "010", 1), ops + 1)
return ops
N = int(input())
s = input()
print(count_ops(s, 0)) |
s841234361 | p03582 | u311540743 | 1507693580 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 730 | def work(a,b,c,A,B,C):
if A==0:
return work(b,c,'',B,C,0)
if B==0:
if C==0:
return a*A
else:
return work(a,c,'',A,C,0)
if C==0:
return work(a+b*(B/A),a+b*(B/A+1),'',A-B%A,B%A,0)
cmod = C%A
if B <= A-cmod:
return work(a+c*(C/A),a+c*(C/A)+b,a+c*(C... |
s662970564 | p03583 | u397496203 | 1601000105 | Python | PyPy3 (7.3.0) | py | Runtime Error | 287 | 68212 | 643 | import sys
# sys.setrecursionlimit(100000)
def input():
return sys.stdin.readline().strip()
def input_int():
return int(input())
def input_int_list():
return [int(i) for i in input().split()]
def main():
n = input_int()
for a in range(1, 3501):
for b in range(1, 3501):
nu... |
s046367444 | p03583 | u991713078 | 1600980609 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8960 | 19 | N=input()
A=N//4+1
|
s726971083 | p03583 | u955248595 | 1600698006 | Python | Python (3.8.2) | py | Runtime Error | 57 | 9260 | 1086 | # (A,B,C)<=3500
# 4/N = (1/A)+(1/B)+(1/C)
# (4/N)-(1/A) = (1/B)+(1/C)
# (4A-N)/AN = (B+C)/BC
# XX-(4A-N)X+AN=0
# X = (-b±sqrt(bb-4c))/2 (a=1)
# = ((4A-N)±sqrt((4A-N)(4A-N)-4AN))/2
# = ((4A-N)±sqrt(16AA-12AN+NN))/2
def BiSearch(Func,N):
Left = 0
FLeft = Func(Left)
Right = N
FRight = Func(Right... |
s949915128 | p03583 | u370721525 | 1599736255 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9124 | 567 | N = int(input())
if N % 2 == 0:
print(N//2, N, N)
else:
for i in range(1, N):
if N < 4*i:
n = 4*i - N
break
if n == 1:
j, k = 2*N*i, 2*N*i
else:
if i % 3 == 0:
j, k = 2*N*i//3, 2*N*i//3
else:
for x in range(10):
flag = False
for y in range(1, n//2+1):
... |
s198652635 | p03583 | u687574784 | 1598426970 | Python | Python (3.8.2) | py | Runtime Error | 2205 | 9160 | 317 | N = int(input())
for n in range(1,3501):
for w in range(1,3501):
if N*n*w % (n*w - N*(n+w)):
continue
if 4*n*w < N*(n+w):
continue
h = (N*n*w) // (4*n*w - N*(n+w))
if 4*h*n*w == N*(n*w + h*w + h*n):
print(h, n, w)
exit()
|
s681792564 | p03583 | u779805689 | 1597984543 | Python | PyPy3 (7.3.0) | py | Runtime Error | 250 | 73912 | 233 | N=int(input())
for h in range(1,3500+1):
for n in range(1,3500+1):
if (N*h*n)%(4*h*n-N*(h+n))==0:
try:
H,N,W=h,n,(N*h*n)//(4*h*n-N*(h+n))
except:
pass
print(H,N,W) |
s047054151 | p03583 | u706414019 | 1596886635 | Python | Python (3.8.2) | py | Runtime Error | 518 | 9104 | 309 | N = int(input())
if N%2==0:
a=N//2
b=N
c=N
print(a,b,c)
else:
for ai in range(N//4,3500):
for bi in range(N//4,3500):
ci = N*ai*bi/(4*ai*bi-N*ai-N*bi)
if ci == int(ci) and ci > 0:
print(ai,bi,int(ci))
exit()
|
s483117541 | p03583 | u309716323 | 1596348012 | Python | PyPy3 (7.3.0) | py | Runtime Error | 99 | 74588 | 599 |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
"""
h, n, w <= 3500
4*h*n*w/(h*n+n*w+h*w) = N
n*w+h*w = (n+h)*w = k*h*n => k = (n+h)*w/(h*n)
4hnw/(k+1)hn=4w/(k+1) = N
"""
N = read_int()
for w in r... |
s154816830 | p03583 | u309716323 | 1596347585 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 74556 | 632 |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
"""
h, n, w <= 3500
4*h*n*w/(h*n+n*w+h*w) = N
n*w+h*w = (n+h)*w = k*h*n => k = (n+h)*w/(h*n)
4hnw/(k+1)hn=4w/(k+1) = N
"""
N = read_int()
for w in r... |
s454896345 | p03583 | u309716323 | 1596347472 | Python | PyPy3 (7.3.0) | py | Runtime Error | 81 | 68860 | 633 |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
"""
h, n, w <= 3500
4*h*n*w/(h*n+n*w+h*w) = N
n*w+h*w = (n+h)*w = k*h*n => k = (n+h)*w/(h*n)
4hnw/(k+1)hn=4w/(k+1) = N
"""
N = read_int()
for w in r... |
s976508017 | p03583 | u309716323 | 1596347429 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 74840 | 711 |
def read_int():
return int(input().strip())
def read_ints():
return list(map(int, input().strip().split(' ')))
def solve():
"""
h, n, w <= 3500
4*h*n*w/(h*n+n*w+h*w) = N
n*w+h*w = (n+h)*w = k*h*n => k = (n+h)*w/(h*n)
4hnw/(k+1)hn=4w/(k+1) = N
"""
N = read_int()
for w in r... |
s889189011 | p03583 | u277236383 | 1595624848 | Python | PyPy3 (7.3.0) | py | Runtime Error | 131 | 74840 | 592 |
n = int(input())
if n %2 == 0:
ans1 = str(n)
ans2 = str(n//2)
print(ans1 + " " + ans1 + " " + ans2)
quit()
if n % 3 == 0:
ans1 = str(n*2)
ans2 = str(n//3)
print(ans1 + " " + ans1 + " " + ans2)
quit()
for i in range(1, 3501):
for j in range(1, 3501):
k = int(1/(4/n-1/i-1/j))
if k>0 and ... |
s083387436 | p03583 | u277236383 | 1595624503 | Python | PyPy3 (7.3.0) | py | Runtime Error | 104 | 74496 | 331 | n = int(input())
if n %2 == 0:
ans1 = str(n)
ans2 = str(n//2)
print(ans1 + " " + ans1 + " " + ans2)
quit()
for i in range(1, 876):
for j in range(1, 876):
k = int(1 / (4/n - 1/(4*i) - 1/(4*j) ))
if k>0 and 4/n==1/(4*i)+1/(4*j)+1/k:
print(str(i*4)+" "+str(j*4)+" "+str(k))
quit()
|
s866612799 | p03583 | u277236383 | 1595624465 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 74716 | 339 | n = int(input())
"""
if n %2 == 0:
ans1 = str(n)
ans2 = str(n//2)
print(ans1 + " " + ans1 + " " + ans2)
quit()
"""
for i in range(1, 876):
for j in range(1, 876):
k = int(1 / (4/n - 1/(4*i) - 1/(4*j) ))
if k>0 and 4/n==1/(4*i)+1/(4*j)+1/k:
print(str(i*4)+" "+str(j*4)+" "+str(k))
qu... |
s548309863 | p03583 | u879309973 | 1595506883 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8860 | 449 | #include <iostream>
using namespace std;
int main() {
const int ub = 3500;
int n; cin >> n;
for (int x = 1; x <= ub; ++x) {
for (int y = 1; y <= ub; ++y) {
int p = n*x*y;
int q = 4*x*y - n*y - n*x;
if ((q > 0) && (p % q == 0)) {
int z = p / q;
... |
s121946366 | p03583 | u747703115 | 1595421255 | Python | PyPy3 (7.3.0) | py | Runtime Error | 441 | 75272 | 332 | n = int(input())
if n%2==0:
print(n, n, n//2)
else:
f = False
for i in range(1, 3500):
_h = n/i
for j in range(1,3500):
_n = n/j
w = n/(4-_h-_n)
if w>0 and w%1==0:
print(i, j, int(w))
f = True
if f: break
... |
s259925030 | p03583 | u747703115 | 1595421160 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 9148 | 332 | n = int(input())
if n%2==0:
print(n, n, n//2)
else:
f = False
for i in range(1, 3500):
_h = n/i
for j in range(1,3500):
_n = n/j
w = n/(4-_h-_n)
if w>0 and w%1==0:
print(i, j, int(w))
f = True
if f: break
... |
s090879179 | p03583 | u222668979 | 1594616436 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8924 | 209 | n = int(input())
for h in range(3501):
for w in range(3501):
bns = n * h * w
bnb = 4 * h * w - n * (h + w)
if bns % bnb == 0:
print(h, w, bns // bnb)
break
|
s951540443 | p03583 | u475675023 | 1592924167 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9100 | 136 | N=int(input())
for h in range(3501):
for n in range(3501):
if (N*h*n)%(4*h*n-N*n-N*h)==0:
print(h,n,(N*h*n)%(4*h*n-N*n-N*h)) |
s787154628 | p03583 | u131881594 | 1592875547 | Python | Python (3.8.2) | py | Runtime Error | 2205 | 9128 | 197 | n=int(input())
for i in range(1,3501):
for j in range(1,3501):
t1=n*i*j
t2=4*i*j-n*j-n*i
if t1%t2==0 and 1<=t1//t2<3500:
print(i,j,t1//t2)
exit() |
s956359160 | p03583 | u026155812 | 1592609389 | Python | PyPy3 (7.3.0) | py | Runtime Error | 333 | 75468 | 260 | N = int(input())
ok = False
for i in range(1, 3501):
for j in range(1, 3501):
w = (4/N - 1/i - 1/j)**-1
if w > 0 and abs(int(w) - w) < 10**-7:
print(i, j, int(w))
ok = True
break
if ok:
break |
s032112948 | p03583 | u426764965 | 1592528093 | Python | Python (3.8.2) | py | Runtime Error | 2206 | 9132 | 211 | N = int(input())
b, c, d = 1, 1, 2
while True:
x = N//4 + b
y = c*N*x
tmp = c * (4*x - N) - 1
if y % tmp == 0:
z = y // tmp
break
else:
b += 1
print(*[x,y,z], sep=' ') |
s152745956 | p03583 | u134019875 | 1592204412 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 208 | N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
w = (N * h * n) / (4 * h * n - N * n - N * h)
if w > 0 and w % 1 == 0:
print(h, n, int(w))
exit() |
s166796028 | p03583 | u798260206 | 1591027792 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 3060 | 198 | N = int(input())
for h in range(1,3501):
for n in range(1,3501):
if (4*h*n-N*n-N*h)!= 0:
w = N*h*n/(4*h*n-N*n-N*h)
if w >0 and w.is_integer():
print(h,n,int(w))
exit() |
s082703515 | p03583 | u707498674 | 1590608488 | Python | Python (3.4.3) | py | Runtime Error | 238 | 3060 | 288 | def main():
N = int(input())
for h in range(1, 3501):
for n in range(h+N-1, 3501):
if N*h*n % (4*h*n - N*h - N*n)==0:
w = N*h*n // (4*h*n - N*h - N*n)
print(h, n, w)
exit()
if __name__ == "__main__":
main() |
s251473081 | p03583 | u075595666 | 1589894440 | Python | Python (3.4.3) | py | Runtime Error | 1171 | 3064 | 416 | N = int(input())
import math
U = math.ceil(3*N/4)
D = math.ceil(N/4)
if N % 2 == 0:
print(N,N,N//2)
else:
if D%2 == 1:
D += 1
h = -1
for n in range(D,3500):
if h > 0:
break
for w in range(n,3500):
#print(h,n,w)
if w*n*N/(4*n*w-w*N-n*N) == int(w*n*N/(4*n*w-w*N-n*N)):
h = w*n... |
s653121835 | p03583 | u373047809 | 1588967071 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 210 | N = int(input())
for h in range(3500):
for n in range(n):
try:w = (N*h*n) / (4*n*h - N*n - N*h)
except ZeroDivisionError: continue
if w>0 and w.is_integer():
print(h, n, int(w))
exit() |
s619457327 | p03583 | u373047809 | 1588966850 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 157 | N = int(input())
for h in range(3500):
for n in range(3500):
w = (N*h*n) / (4*n*h - N*n - N*h)
if w>0 and w.is_integer():
print(h, n, int(w)) |
s405616647 | p03583 | u373047809 | 1588966807 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 155 | N = int(input())
for h in range(3500):
for n in range(3500):
w = (N*h*n) / (4*n*h - N*n - N*h)
if w>0 and w.is_integer:
print(h, n, int(w)) |
s820042695 | p03583 | u346812984 | 1587084489 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 603 | import sys
sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7
def input():
return sys.stdin.readline().strip()
def solve(N):
N = int(input())
M = 3501
for h in range(1, M):
for n in range(h, M):
denominator = 4 * n * h - N * h - N * n
if denominator... |
s181070349 | p03583 | u872538555 | 1586704028 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 536 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
for(int n = 1; n <= 3500; n++){
for(int w = 1; w <= 3500; w++){
int h_up, h_down;
h_up = N * n * w;
h_down = 4 * n * w - N *(n + w);
if(h_down <= 0) continue... |
s870056322 | p03583 | u872538555 | 1586703921 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 537 | #include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
for(int n = 1; n <= 3500; n++){
for(int w = 1; w <= 3500; w++){
int h_up, h_down;
h_up = N * n * w;
h_down = 4 * n * w - N *(n + w);
if(h_down <= 0) continue... |
s631907181 | p03583 | u859125915 | 1586421642 | Python | Python (3.4.3) | py | Runtime Error | 2107 | 2940 | 229 | N = int(input())
for a in range(1,3501):
for b in range(1,3501):
m = (4*a*b) - N*(a+b)
if m> 0 & N*a*b % m == 0:
c = (N*a*b)//m
break
else:
continue
break
print(a,b,c)
|
s294072760 | p03583 | u859125915 | 1586421591 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 2940 | 230 | N = int(input())
for a in range(1,3501):
for b in range(1,3501):
m = (4*a*b) - N*(a+b)
if m>= 0 & N*a*b % m == 0:
c = (N*a*b)//m
break
else:
continue
break
print(a,b,c)
|
s574654199 | p03583 | u423585790 | 1585428821 | Python | PyPy3 (2.4.0) | py | Runtime Error | 217 | 39280 | 1173 | #!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return... |
s023232945 | p03583 | u375616706 | 1584903905 | Python | Python (3.4.3) | py | Runtime Error | 1851 | 2940 | 187 | N = int(input())
for h in range(1, 3501):
for w in range(1, 3501):
u = 4*h*w-N*w-N*h
d = N*h*w
if d % u == 0:
print(h, w, d//u)
exit()
|
s489349372 | p03583 | u375616706 | 1584903664 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 400 | MOD = 10**9+7
N = int(input())
L = list(map(lambda x: bin(int(x))[2:], input().split()))
max_len = max([len(v) for v in L])
padL = ["0"*(max_len-len(v))+v for v in L]
cnt = [0]*max_len
for i in range(max_len):
for l in padL:
cnt[i] += 1 if l[i] == "1" else 0
ans = 0
v = 1
for i in range(max_len):
ans +... |
s836981092 | p03583 | u096616343 | 1584647784 | Python | PyPy3 (2.4.0) | py | Runtime Error | 464 | 45532 | 233 | N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
if (N * h * n) % (4 * h * n - N * n - N * h) == 0:
w = (N * h * n) // (4 * h * n - N * n - N * h)
print(h, n, w)
break |
s578061354 | p03583 | u539517139 | 1584316580 | Python | Python (3.4.3) | py | Runtime Error | 1605 | 3060 | 154 | n=int(input())
for i in range(1,3501):
for j in range(1,3501):
if (n*i*j)%(4*i*j-n*i-n*j)==0:
print(i,j,(n*i*j)//(4*i*j-n*i-n*j))
exit() |
s648887143 | p03583 | u814781830 | 1584188357 | Python | PyPy3 (2.4.0) | py | Runtime Error | 347 | 39536 | 360 | def calc(N, h, n):
base = 4/N - 1/h - 1/n
if base == 0:
return False, 0
ret = 1/base
return ret == int(ret) and 0 <= ret <= 3500, int(ret)
N = int(input())
def f(N):
for h in range(1, 3501):
for n in range(1, 3501):
judge, ret = calc(N,h,n)
if judge:
... |
s616731678 | p03583 | u814781830 | 1584187197 | Python | PyPy3 (2.4.0) | py | Runtime Error | 330 | 39408 | 352 | def calc(N, h, n):
base = 4/N - 1/h - 1/n
if base == 0:
return False, 0
ret = 1/base
return ret == int(ret) and ret >= 0, int(ret)
N = int(input())
def f(N):
for h in range(1, 3501):
for n in range(1, 3501):
judge, ret = calc(N,h,n)
if judge:
... |
s177974074 | p03583 | u814781830 | 1584186925 | Python | PyPy3 (2.4.0) | py | Runtime Error | 327 | 39408 | 351 | def calc(N, h, n):
base = 4/N - 1/h - 1/n
if base == 0:
return False, 0
ret = 1/base
return ret == int(ret) and ret > 0, int(ret)
N = int(input())
def f(N):
for h in range(1, 3501):
for n in range(1, 3501):
judge, ret = calc(N,h,n)
if judge:
... |
s939380613 | p03583 | u572142121 | 1583846861 | Python | Python (3.4.3) | py | Runtime Error | 1716 | 3060 | 223 | N=int(input())
if N%2==0:
print(N//2,N,N)
else:
for i in range(1,3501):
for j in range(1,3501):
if 4*i*j-N*i-N*j>0:
if (N*i*j/(4*i*j-N*i-N*j)).is_integer():
print(i,j,int(w))
exit() |
s463722938 | p03583 | u572142121 | 1583846833 | Python | Python (3.4.3) | py | Runtime Error | 1947 | 3064 | 221 | N=int(input())
if N%2==0:
print(N//2,N,N)
else:
for i in range(1,3501):
for j in range(1,3501):
if 4*i*j-N*i-N*j>0:
if N*i*j/(4*i*j-N*i-N*j).is_integer():
print(i,j,int(w))
exit() |
s100424076 | p03583 | u572142121 | 1583846773 | Python | Python (3.4.3) | py | Runtime Error | 1884 | 3060 | 215 | N=int(input())
if N%2==0:
print(N//2,N,N)
else:
for i in range(1,3501):
for j in range(1,3501):
if 4*i*j-N*i-N*j>0 and (N*i*j)/(4*i*j-N*i-N*j).is_integer():
print(i,j,int(w))
exit() |
s771474590 | p03583 | u572142121 | 1583846061 | Python | PyPy3 (2.4.0) | py | Runtime Error | 239 | 40556 | 162 | N=int(input())
for i in range(1,3501):
for j in range(1,3501):
w=(N*i*j)/(4*i*j-N*i-N*j)
if w>0 and w.is_integer():
print(i,j,int(w))
exit() |
s851350829 | p03583 | u572142121 | 1583845997 | Python | PyPy3 (2.4.0) | py | Runtime Error | 249 | 40556 | 210 | N=int(input())
if N%2==0:
print(N//2,N,N)
else:
for i in range(1,3501):
for j in range(1,3501):
w=(N*i*j)/(4*i*j-N*i-N*j)
if w>0 and w.is_integer():
print(i,j,int(w))
exit()
|
s072560668 | p03583 | u572142121 | 1583845840 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 209 | N=int(input())
if N%2==0:
print(N//2,N,N)
else:
for i in range(1,3501):
for j in range(1,3501):
w=(N*i*j)/(4*i*j-N*i-N*j)
if w>0 and w.is_integer():
print(i,j,int(w))
exit() |
s745285049 | p03583 | u672475305 | 1583351486 | Python | PyPy3 (2.4.0) | py | Runtime Error | 556 | 43356 | 300 | def f(N,h,n):
return 4/N - 1/h - 1/n
N = int(input())
for h in range(1, 3500):
for n in range(1, 3500):
inv_w = f(N, h, n)
if inv_w > 0:
w = 1/inv_w
if w.is_integer() and 1<=w<=3500:
ans = [h,n,int(w)]
break
print(*ans) |
s952712822 | p03583 | u672475305 | 1583350903 | Python | PyPy3 (2.4.0) | py | Runtime Error | 560 | 43612 | 279 | def f(N,h,n):
return 4/N - 1/h - 1/n
N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
tmp = f(N, h, n)
if tmp > 0:
w = 1/tmp
if w.is_integer():
ans = [h,n,int(w)]
break
print(*ans) |
s567793283 | p03583 | u672475305 | 1583350705 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 274 | def f(N,h,n):
return 4/N - 1/h - 1/n
N = int(input())
for h in range(1, 5):
for n in range(1, 5):
tmp = f(N, h, n)
if tmp != 0:
w = 1/tmp
if w.is_integer():
ans = [h,n,int(w)]
break
print(*ans) |
s514272159 | p03583 | u623819879 | 1582686511 | Python | PyPy3 (2.4.0) | py | Runtime Error | 887 | 50904 | 2938 | from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():
*a,=map(int,open(0))
def S_():
re... |
s170274397 | p03583 | u457901067 | 1581965467 | Python | Python (3.4.3) | py | Runtime Error | 230 | 3064 | 426 | N = int(input())
# a >= b >= c を仮定できる
# a,b,c <= 3500
# 4/N <= 3/a a <= 0.75N
# 4/N >= 3/c c >= 0.75N
amax = int(0.75 * N) + 2
bmin = int(0.75 * N) - 1
max = 3501
for b in range(bmin,max):
for a in range(1,amax):
res = 4/N - 1/a - 1/b
if res<=0:
continue
candc = int(1/res)
for c in range(can... |
s217930671 | p03583 | u540877546 | 1580080831 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 2940 | 176 | N = int(input())
for n in range(1, 3501):
for w in range(n, 3501):
t = (N*n*w) % (4*n*w - N*w - N*w)
if t == 0:
print(t,n,w)
exit()
|
s060351276 | p03583 | u540877546 | 1580080762 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38384 | 176 | N = int(input())
for n in range(1, 3501):
for w in range(i, 3501):
t = (N*n*w) % (4*n*w - N*w - N*w)
if t == 0:
print(t,n,w)
exit()
|
s135272368 | p03583 | u540877546 | 1580080668 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38504 | 176 | N = int(input())
for n in range(1, 3501):
for w in range(i, 3501):
t = N*n*w % (4*n*w - N*w - N*w)
if t == 0:
print(t, i, j)
exit()
|
s017280618 | p03583 | u540877546 | 1580080596 | Python | PyPy3 (2.4.0) | py | Runtime Error | 240 | 40428 | 148 | N = int(input())
for i in range(1,3501):
for j in range(i,3501):
t = N*i*j % (4*i*j - N*i - j*N)
if t==0:
print(t,i,j)
exit()
|
s208279692 | p03583 | u540877546 | 1580080547 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38384 | 148 | n = int(input())
for i in range(1,3501):
for j in range(i,3501):
t = N*i*j % (4*n*w - N*w - n*N)
if t==0:
print(t,i,j)
exit()
|
s072579654 | p03583 | u683134447 | 1580078136 | Python | PyPy3 (2.4.0) | py | Runtime Error | 415 | 67052 | 318 | n = int(input())
from fractions import Fraction
for i in range(1,3501):
for j in range(1,3501):
if (i * j * n) % (4*i*j - n*i - n*j) == 0 and (i * j * n) // (4*i*j - n*i - n*j) > 0:
print(i,j)
print((i * j * n) // (4*i*j - n*i - n*j))
import sys
sys.exit() |
s469755988 | p03583 | u580697892 | 1578807567 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 260 | # coding: utf-8
N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
w = (N*(h+n)) / (4*h*n-N)
if w != int(w) or w < 0:
continue
if N == 4*h*n*w / (h+n+w):
print(h, n, int(w))
exit() |
s126829587 | p03583 | u955125992 | 1578362858 | Python | PyPy3 (2.4.0) | py | Runtime Error | 943 | 40940 | 349 | N = int(input())
for h in range(1, 3501):
for n in range(1, 14000):
if 4/N - 1/h -1/n == 0:
continue
else:
w = N * h * n /(4*h*n-N*n-N*h)
if 4/N != 1/h + 1/n + 1/w:
continue
elif w > 0 and w.is_integer():
print(h, n, i... |
s104942174 | p03583 | u179169725 | 1578192266 | Python | Python (3.4.3) | py | Runtime Error | 1609 | 3316 | 380 | # https://atcoder.jp/contests/tenka1-2017/tasks/tenka1_2017_c
# 式をこねくり回せ
N = int(input())
from itertools import product
for n, h in product(range(1, 3501), range(1, 3501)):
if (4 / N - 1 / h - 1 / n) <= 0:
continue
bunbo = (4 * n * h - N * n - N * h)
w = (N * h * n) / bunbo
if w.is_integer():... |
s204223336 | p03583 | u296518383 | 1577849419 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38384 | 244 | N = int(input())
for h in range(1, 3501):
if 1 / h < 4 / N:
for n in range(1, h + 1):
if 1 / h + 1 / n < 4 / N:
w = 1 / (4 / N - 1 / h - 1 / n)
if w.is_integer() w > 0:
print(h, n, int(w))
exit() |
s804621950 | p03583 | u296518383 | 1577849286 | Python | PyPy3 (2.4.0) | py | Runtime Error | 283 | 40812 | 229 | N = int(input())
for h in range(1, 3501):
if 1 / h < 4 / N:
for n in range(1, h):
w = 1 / (4 / N - 1 / h - 1 / n)
if w > 3500:
break
if w.is_integer():
print(h, n, int(w))
exit() |
s702165020 | p03583 | u984276646 | 1577394554 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 471 | N = int(input())
if N % 4 == 0:
h, n, w = (3 * N) // 4, (3 * N) // 4, (3 * N) // 4
elif N % 4 == 2:
h, n, w = N, N, N // 2
elif N % 4 == 3:
s = N // 4 + 1
h, n, w = 2 * s, 2 * s, s * N
elif N % 4 == 1:
s = (N // 4) + 1
if s % 3 == 0:
h = s
n = 2 * (s // 3) * (4 * s - 3)
w = 2 * (s // 3) * (4 * s... |
s057804350 | p03583 | u984276646 | 1577393742 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 471 | N = int(input())
if N % 4 == 0:
h, n, w = (3 * N) // 4, (3 * N) // 4, (3 * N) // 4
elif N % 4 == 2:
h, n, w = N, N, N // 2
elif N % 4 == 3:
h, n, w = 2 * ((N // 4) + 1), 2 * ((N // 4) + 1), (2 * ((N // 4) + 1)) * N
elif N % 4 == 1:
s = (N // 4) + 1
if s % 3 == 0:
h = s
n = 2 * (s // 3) * (4 * s - 3)
... |
s970256425 | p03583 | u311636831 | 1576861401 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 288 | #N=3485
#A=[ 32, 1, 87, 25, 36]
N=int(input())
for i in range(1,3501):
for j in range(1,3501):
u=-N*i*j
d=N*i+N*j-4*i*j
if(u%d==0 and (u*d > 0)):
k=u//d
if(N*(i*j+j*k+k*i)==4*i*j*k):
print(i,j,k)
exit() |
s454326111 | p03583 | u311636831 | 1576861309 | Python | PyPy3 (2.4.0) | py | Runtime Error | 334 | 40556 | 288 | #N=3485
#A=[ 32, 1, 87, 25, 36]
N=int(input())
for i in range(1,3501):
for j in range(1,3501):
u=-N*i*j
d=N*i+N*j-4*i*j
if(u%d==0 and (u*d > 0)):
k=u//d
if(N*(i*j+j*k+k*i)==4*i*j*k):
print(i,j,k)
exit() |
s669480817 | p03583 | u102960641 | 1576434768 | Python | PyPy3 (2.4.0) | py | Runtime Error | 239 | 40300 | 209 | N = int(input())
for h in range(1,3501):
for n in range(1,3501):
a = 4 * h * n - N * (h + n)
if a > 0:
w,b = divmod(N * h * n, mod)
if b == 0:
print(h,n,w)
exit()
|
s080365704 | p03583 | u349091349 | 1575578055 | Python | PyPy3 (2.4.0) | py | Runtime Error | 251 | 40684 | 204 | import sys
N=int(input())
for h in range(1,3501):
for n in range(1,h):
a = h*n*N
b = -(n+h)*N + 4*h*n
if a % b ==0 and a*b>0:
print(h,n,a//b)
sys.exit() |
s944776690 | p03583 | u905582793 | 1574747285 | Python | PyPy3 (2.4.0) | py | Runtime Error | 273 | 41196 | 278 | N = int(input())
for x in range(1, 3501):
for y in range(1, 3501):
if N*x*y/(4*x*y-N*(x+y)) == int(N*x*y/(4*x*y-N*(x+y))) and int(N*x*y/(4*x*y-N*(x+y))) > 0:
print(x, y, int(N*x*y/(4*x*y-N*(x+y))))
break
else:
continue
break
|
s647003790 | p03583 | u779455925 | 1573752020 | Python | Python (3.4.3) | py | Runtime Error | 2103 | 3064 | 792 | N=int(input())
a=4/N
h_st=int(N*(1/4))
for h in range(h_st,3501):
H=1/h
for n in range(h,3501):
flag=0
if a-H-1/n-1/n<=0 and a-H-1/n-1/3500>=0:
st,end=h,3500
for w in [st,end]:
B=4*h*n*w-(n*w+h*w+h*n)*N
if B==0:
break
... |
s261053990 | p03583 | u223904637 | 1571546066 | Python | Python (3.4.3) | py | Runtime Error | 1617 | 3064 | 188 | n=int(input())
for i in range(1,3501):
for j in range(1,3501):
if (n*i*j)%(4*i*j-n*i-n*j)==0:
w=(n*i*j)//(4*i*j-n*i-n*j)
print(i,j,w)
exit() |
s338672264 | p03583 | u009348313 | 1569688004 | Python | PyPy3 (2.4.0) | py | Runtime Error | 194 | 40684 | 223 | N = int(input())
if N % 2 == 0:
print(N//2,N,N)
else:
for h in range(2,3501,2):
for n in range(2,3501,2):
w = h*n*N/(4*h*n-n*N-h*N)
if w > 0 and w.is_integer():
print(h,n,int(w))
exit()
|
s015557291 | p03583 | u223646582 | 1568862115 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 2940 | 191 | N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
w = N*h*n/(4*h*n-N*n-N*h)
if w == int(w) and w >= 1:
print(h, n, int(w))
exit()
|
s405815729 | p03583 | u477977638 | 1568523628 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 171 | N=int(input())
for h in range(1,3501):
for n in range(1,3501):
w=1/(4/N-1/h-1/n)
if abs(w-int(w))<10**(-6) and w>0:
print(h,n,int(w),sep=" ")
exit(0) |
s623902525 | p03583 | u698176039 | 1567467553 | Python | PyPy3 (2.4.0) | py | Runtime Error | 312 | 41580 | 299 | import sys
N = int(input())
for h in range(1,3501):
for n in range(1,3501):
if (N*h*n)%(4*h*n-N*(h+n)) == 0:
w = N*h*n // (4*h*n-N*(h+n))
if w <= 0:continue
if h*n*w % N == 0:
print(h,n,w)
sys.exit()
print(-1) |
s721967911 | p03583 | u532966492 | 1563332675 | Python | Python (3.4.3) | py | Runtime Error | 745 | 3064 | 358 | n=int(input())
def abc(N,a,b,c):
return 4*a*b*c-N*(a*b+b*c+c*a)
for i in range(1,3501):
flag=0
if (1/i)>=(4/n):
continue
for j in range(i,3501):
k=int((n*i*j)/(4*i*j-n*i-n*j))
if k>0:
if abc(n,i,j,k)==0:
print(i,j,k)
flag=1
... |
s392365340 | p03583 | u391731808 | 1562762087 | Python | PyPy3 (2.4.0) | py | Runtime Error | 364 | 42520 | 214 | N = int(input())
flg = False
for a in range(1,3501):
for b in range(a,3501):
A = 4*a*b - N*(a+b)
B = N*a*b
if B%A==0 and A//B>0:
c = B//A
flg = True
break
if flg:break
print(a,b,c) |
s567067656 | p03583 | u981767024 | 1562116705 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 439 | # 2019/07/02
# Tenka1 Programmer Contest - C
# 4/N-1/h-1/n=1/w
# 1/(4/N-1/h-1/n)=w
# Input
n = int(input())
eflg = False
for i in range(1, 3501):
for j in range(1, 3501):
w = (n * i * j) / (4 * i * j - n * i - n * j)
if w > 0:
if int(w) == w:
ans = [i, j, int(w)]
... |
s719554215 | p03583 | u767664985 | 1561948334 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 197 | import sys
N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
tmp = 4 * n * h - N * n - N * h
if tmp > 0:
if (N * h * n) % tmp == 0:
sys.exit(h, n, (N * h * n) // tmp)
|
s195550698 | p03583 | u767664985 | 1561947753 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 289 | N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
if (4 * n * h - N * n - N * h) != 0:
if (N * h * n) % (4 * n * h - N * n - N * h) == 0
if (N * h * n) // (4 * n * h - N * n - N * h) > 0:
print(h, n, (N * h * n) // (4 * n * h - N * n - N * h))
exit()
|
s172873341 | p03583 | u767664985 | 1561947453 | Python | Python (3.4.3) | py | Runtime Error | 1657 | 3060 | 256 | N = int(input())
for h in range(1, 3501):
for n in range(1, 3501):
if (N * h * n) % (4 * n * h - N * n - N * h) == 0 and (N * h * n) // (4 * n * h - N * n - N * h) in ragne(1, 3501):
print(h, n, (N * h * n) // (4 * n * h - N * n - N * h))
exit()
|
s616755792 | p03583 | u167681750 | 1561750524 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 232 | N = int(input())
for x,y in product(range(1,3501), range(1,3501)):
temp = (4/N) - (1/x) - (1/y)
if temp > 0:
z = 1/temp
int_z = int(z)
if int_z == z:
print(x, y, int_z)
exit() |
s260271350 | p03583 | u620945921 | 1561119706 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38412 | 299 | N=int(input())
flag=0
for h in range(1,3501):
if flag==1:
break:
for n in range(h,3501):
if flag==1:
break:
else:
val=4*h*n-n*N-h*N
if val != 0:
w=N*h*n/val
if int(w)==w and w > 0:
print(h,n,int(w))
flag=1
|
s954298382 | p03583 | u623687794 | 1560816509 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3468 | 150 | N=int(input())
for w in range(1,3501):
for n in range(1,3501):
if N*w*n%(4*w*n-N*n-N*w)==0:
print(N*w*n//(4*w*n-N*n-N*w),w,n)
break
|
s725261567 | p03583 | u167681750 | 1559869254 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 232 | N = int(input())
for h, n in product(range(1, 3501), range(1, 3501)):
a = (4 * h * n - N * n - N * h)
if a != 0:
w = (N * h * n) / a
if w == int(w) and w > 1:
print(n,h,int(w))
exit() |
s099942902 | p03583 | u167681750 | 1559869070 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 226 | N = int(input())
for h, n in product(range(1, 3501), range(1, 3501)):
a = (4 * h * n - N * n - N * h)
if a != 0:
w = (N * h * n) / a
if w == w//1 and w > 1:
print(n,h,w)
exit()
|
s021495683 | p03583 | u654470292 | 1559678129 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 240 | n=int(input())
for i in range(1,3501):
for j in range(j,3501):
if 4*i*j-n*i-n*j>0 and n*i*j%(4*i*j-n*i-n*j)==0:
w=n*i*j//(4*i*j-n*i-n*j)
print(i,j,w)
quit()
else:
continue |
s434521880 | p03583 | u654470292 | 1559677624 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3468 | 223 | n=int(input())
for i in range(1,3501):
for j in range(1,3501):
if n*i*j%(4*i*j-n*i-n*j)==0:
w=int(n*i*j/(4*i*j-n*i-n*j))
print(i,j,w)
break
else:
continue |
s001797164 | p03583 | u923712635 | 1558234371 | Python | PyPy3 (2.4.0) | py | Runtime Error | 560 | 40684 | 337 | N = int(input())
ans = []
n = 4/N
for i in range(1,3501):
flag = True
for j in range(1,3501):
if(n-1/i-1/j==0):
continue
k = 1/(n-1/i-1/j)
if(int(k)==k and k>0):
ans=[i,j,int(k)]
flag = False
break
if(not flag):
break
print(ans[... |
s894375392 | p03583 | u923712635 | 1558233146 | Python | PyPy3 (2.4.0) | py | Runtime Error | 571 | 41308 | 270 | N = int(input())
ans = []
n = 4/N
for i in range(3501,0,-1):
for j in range(3501,0,-1):
if(n-1/i-1/j==0):
continue
k = 1/(n-1/i-1/j)
if(int(k)==k and k>0):
ans=[i,j,k]
break
print(ans[0],ans[1],int(ans[2])) |
s247958739 | p03583 | u923712635 | 1558232804 | Python | PyPy3 (2.4.0) | py | Runtime Error | 845 | 42668 | 264 | N = int(input())
ans = []
n = 4/N
for i in range(N,0,-1):
for j in range(N,0,-1):
if(n-1/i-1/j==0):
continue
k = 1/(n-1/i-1/j)
if(int(k)==k and k>0):
ans=[i,j,k]
break
print(ans[0],ans[1],int(ans[2])) |
s566264213 | p03583 | u551909378 | 1558043601 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 303 | import math
N = int(input())
for h in range(math.ceil(N/4),3501):
for n in range(math.ceil(1/(4/N-1/h)),3501):
a = 4/N - 1/h - 1/n
if a!= 0:
w = 1/a
if 4*h*n*w == N*(h*n+n*w+w*h):
break
else:
continue
break
print(h,n,int(w)) |
s924433736 | p03583 | u551909378 | 1558043560 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 324 | import math
N = int(input())
for h in range(math.ceil(N/4),3501):
for n in range(math.ceil(1/(4/N-1/h)),3501):
a = 4/N - 1/h - 1/n
print(h,n,a)
if a!= 0:
w = 1/a
if 4*h*n*w == N*(h*n+n*w+w*h):
break
else:
continue
break
print(h,n,int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.