submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s085909181 | p00107 | Accepted | while True:
le=map(float,raw_input().split())
if le==[0,0,0]:
break
mdl=min([(le[i-1]**2+le[i]**2)**0.5 for i in xrange(3)])
for u in xrange(input()):
if input()*2>mdl:
print "OK"
else:
print "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s114922427 | p00107 | Accepted | import math
while 1:
es = map(int, raw_input().split())
if es == [0, 0, 0]: break
r = math.hypot(*sorted(es)[:2]) / 2
for i in range(int(raw_input())):
print 'OK' if int(raw_input()) > r else 'NA' | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s868977668 | p00107 | Accepted | import math
while True:
l,w,h=map(int,raw_input().split())
if l==w==h==0:
break
n=input()
for i in range(n):
r=input()
leng=math.sqrt(pow(w,2)+pow(h,2))/2
if r>leng:
print "OK"
else:
print "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s981644406 | p00107 | Accepted |
import sys
import math
def solv(l, w, h, ent):
cheese = [l, w, h]
cheese.pop(cheese.index(max(cheese)))
diagonal = math.sqrt(cheese[0] ** 2 + cheese[1] ** 2)
ent_size = map(lambda x: x * 2, ent)
for size in ent_size:
if diagonal < size:
print 'OK'
else:
pri... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s303386342 | p00107 | Accepted | from math import sqrt
while True:
inp = raw_input()
if inp == "0 0 0": break
cs = map(int,inp.split())
cs.sort()
c = sqrt(cs[0]**2 + cs[1]**2)/2
n=int(raw_input())
for gomi in xrange(n):
r = int(raw_input())
if c<r: print "OK"
else: print "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s864386778 | p00107 | Accepted | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from math import hypot
def main(readline=stdin.readline):
answer = ('NA', 'OK')
while 1:
height, width, depth = (float(s) for s in readline().split())
if not height:
exit()
h... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s263779534 | p00107 | Accepted | while 1:
s=map(int, raw_input().split())
s.sort()
if s==[0,0,0]: break
n = input()
cr = float(s[0]**2+s[1]**2)/4.0
for i in xrange(n):
r = input()
print "OK" if cr<r**2 else "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s571617313 | p00107 | Accepted | while 1:
s=map(int, raw_input().split())
s.sort()
if s==[0,0,0]: break
n = input()
cr = s[0]**2+s[1]**2
for i in xrange(n):
r = input()
print "OK" if cr<4*r**2 else "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s885282051 | p00107 | Accepted | import sys
import math
def solv(l, w, h, ent):
cheese = [l, w, h]
cheese.pop(cheese.index(max(cheese)))
diagonal = math.sqrt(cheese[0] ** 2 + cheese[1] ** 2)
ent_size = map(lambda x: x * 2, ent)
for size in ent_size:
if diagonal < size:
print 'OK'
else:
pr... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s167072046 | p00107 | Accepted | import math
while True:
w,l,h = map(int, raw_input().split())
if w == 0:
break
d = [math.sqrt(w**2+l**2), math.sqrt(l**2+h**2), math.sqrt(h**2+w**2)]
m = min(d)
n = int(raw_input())
for i in range(n):
r = int(raw_input())
if 2*r > m:
print "OK"
else:
... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s204210912 | p00107 | Accepted | while True:
size = map(int, raw_input().split())
if sum(size) == 0: break
size.remove(max(size))
m = (size[0]**2 + size[1]**2) ** 0.5
for i in range(input()):
n = input()
print "OK" if m < n * 2 else "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s506945216 | p00107 | Accepted | # 長方体の内小さい2辺を元に長方形の外接円を考える
# sqrt(a^2+b^2)/2が長方形の外接円の半径となるため
# r>sqrt(a^2+b^2)/2であれば入口に接さずにチーズを搬入可能
while 1:
dwh = list(map(int,input().split()))
if dwh[0]==dwh[1]==dwh[2]==0:
break
dwh.sort()
cir = ((dwh[0]**2 + dwh[1]**2)**(1/2))/2
n = int(input())
for i in range(n):
print("OK"... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s549058791 | p00107 | Accepted | import math
while True :
d, w, h = map(int, input().split())
if d == 0 and w == 0 and h == 0 :
break
length = [d, w, h]
len_1 = sorted([d, w, h])[0]
len_2 = sorted([d, w, h])[1]
max_d = math.sqrt(len_1**2 + len_2**2)
n = int(input())
for i in range(n) :
r = int(... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s265442421 | p00107 | Accepted | while True:
d, w, h = (int(x) for x in input().split())
if d == 0: break
q = int(input())
vmin = min(d * d + w * w, d * d + h * h, w * w + h * h)
for i in range(0,q):
r = int(input())
ans = 'NA'
if (2 * r) ** 2 > vmin:
ans = 'OK'
print(ans)
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s190983439 | p00107 | Accepted | while True:
d, w,h =list(map(int, input().split()))
if d ==0 and w==0 and h==0:
break
m = min(d*d+w*w, d*d+h*h, w*w+h*h)
for i in range(int(input())):
r = int(input())
if (2*r)**2 >m:
print("OK")
else:
print("NA")
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s077255656 | p00107 | Accepted | # coding=utf-8
###
### for python program
###
import sys
import math
# math class
class mymath:
### pi
pi = 3.14159265358979323846264338
### Prime Number
def pnum_eratosthenes(self, n):
ptable = [0 for i in range(n+1)]
plist = []
for i in range(2, n+1):
if ptable... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s897098276 | p00107 | Accepted | while True:
a=sorted(list(map(int,input().split())))
if sum(a)==0:
break
s=min(a[0]**2+a[1]**2,a[1]**2+a[2]**2,a[0]**2+a[2]**2)
n=int(input())
for i in range(n):
r=int(input())
print("OK" if (r*2)**2>s else "NA")
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s171674386 | p00107 | Accepted | import math
if __name__ == '__main__':
while True:
d,w,h = map(int,input().split())
if d == 0 and w == 0 and h == 0:
break
a1 = math.sqrt(d*d + h*h)
a2 = math.sqrt(d*d + w*w)
a3 = math.sqrt(h*h + w*w)
n = int(input())
for _ in range(n):... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s038507159 | p00107 | Accepted | while 1:
cheese=list(map(int,input().split()))
if cheese[0]==0:break
n=int(input())
cheese=sorted(cheese)
for i in range(n):
radius = int(input())
if radius*2>(cheese[0]**2+cheese[1]**2)**0.5:print("OK")
else:print("NA")
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s739374771 | p00107 | Accepted | while 1:
try:
dwh=list(map(int,input().split()))
if dwh[0]==dwh[1]==dwh[2]==0:break
dwh.sort()
std=(dwh[0]**2+dwh[1]**2)**0.5/2
n=int(input())
for i in range(n):
r=int(input())
if std<r:print("OK")
else:print("NA")
except:break
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s448657154 | p00107 | Accepted | import math
while 1:
d, w, h = map(int, input().split())
if d == 0:
break
datas = []
n = int(input())
for _ in range(n):
r = int(input())
datas.append(r)
cheese = [d, w, h]
cheese.sort()
a = cheese[0]
b = cheese[1]
r = math.sqrt(a**2 + b**2) / 2
fo... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s779985235 | p00107 | Accepted | while True:
d, w, h = map(int, input().split())
if d == 0:
break
d = min(d**2 + w**2, w**2 + h**2, h**2 + d**2)
n = int(input())
for i in range(n):
d_i = (int(input())*2)**2
if d_i > d:
print("OK")
else:
print("NA")
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s459415167 | p00107 | Accepted | while True:
d, w, h = sorted(map(int, input().split()))
if d == w == h == 0:
break
dw = (d**2 + w**2)
n = int(input())
for i in range(n):
y = int(input())
if (2*y)**2 > dw:
print("OK")
else:
print("NA")
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s276835165 | p00107 | Accepted | while True:
ch = list(map(int,input().split()))
if (0 in ch):
break
ch.sort()
n = int(input())
a = ch[0]
b = ch[1]
d = a**2 + b**2
for i in range(n):
r = int(input())
R = 2*r
if (R**2 > d):
print('OK')
else:
print('NA')
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s669590392 | p00107 | Accepted | t = []
temp = 0
while True:
d,w,h = [int(s) for s in input().split(' ')]
if d < w:
temp = d
else:
temp = w
if d == 0 and w == 0 and h == 0:
break
else:
n = int(input())
for i in range(n):
t.append(i)
... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s181523371 | p00107 | Accepted | while(True):
d,w,h = map(int, input().split())
if d == 0 and w == 0 and h == 0:
break
l = min(d*d+w*w,w*w+h*h,h*h+d*d)
n = int(input())
for i in range(n):
r = int(input())
if 4*r*r > l:
print("OK")
else:
print("NA")
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s168436260 | p00107 | Runtime Error | def hantei(A,B,C,R=0):
h,t = sorted([A,B,C])[:2]
if h**2 + t**2 < 4 * R**2:
print 'OK'
else:
print 'NA'
while True:
try:
A,B,C = map(int,raw_input().split())
except EOFError:
break
for k in range(int(raw_input())):
hantei(A,B,C,int(raw_input()))
... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s998799283 | p00107 | Runtime Error | def min_diag(A,B,C):
segments=[A,B,C]
segments.sort()
return (segments[0]**2+segments[1]**2)**(1/2)
while True:
# input one dataset
A,B,C = tuple(map(int,input().split()))
if (A,B,C) == (0,0,0):
break
n = int(input())
R = [None]*n
for i in range(n):
R[i] = int(input())
# process
min_diag... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s405740184 | p00107 | Runtime Error | def min_diag(A,B,C):
segments=[A,B,C]
segments.sort()
return (segments[0]**2+segments[1]**2)**(1/2)
while True:
# input one dataset
A,B,C = tuple(map(float,input().split()))
if (A,B,C) == (0,0,0):
break
n = int(input())
R = [None]*n
for i in range(n):
R[i] = float(input())
# process
min_... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s735229368 | p00107 | Runtime Error | def min_diag(A,B,C):
segments=[A,B,C]
segments.sort()
return (segments[0]**2+segments[1]**2)**(1/2)
while True:
# input one dataset
A,B,C = tuple(map(float,input().split()))
if (A,B,C) == (0,0,0):
break
n = int(input())
R = [None]*n
for i in range(n):
R[i] = float(input())
# process
min_d... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s350252286 | p00107 | Runtime Error | while 1:
d, w, h = map(int, raw_input().split())
dmin = min(d**2 + w**2, w**2+h**2, h**2+d**2)
if dmin == 0:
break
n = input()
for i in range(n):
r = input()
if dmin < 2*r**2:
print 'OK'
else:
print 'NA' | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s590146039 | p00107 | Runtime Error | import sys
for a in sys.stdin:
if'0'==a:break
s=list(map(int,input().split()))
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s834701492 | p00107 | Runtime Error | # AOJ 0107 Carry a Cheese
# Python3 2018.6.17 bal4u
while True:
d, w, h = list(map(int, input().split()))
if d == 0 and w == 0 and h == 0: break
min = min(d*d+w*w, d*d+h*h, w*w+h*h)
for _ in range(int(input())):
r = int(input())
print('OK' if min < (2*r)**2 else 'NA')
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s802909353 | p00107 | Runtime Error | # AOJ 0107 Carry a Cheese
# Python3 2018.6.17 bal4u
while True:
d, w, h = list(map(int, input().split()))
if d == 0 and w == 0 and h == 0: break
min = min(d*d+w*w, d*d+h*h, w*w+h*h)
n = int(input())
for i in range(n):
r = int(input())
print('OK' if (2*r)**2 > min else 'NA')
| 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s397366641 | p00107 | Runtime Error | import math
i, size = 0, 0
rs = []
while True:
line = raw_input()
if line == '0 0 0':
for r in rs:
if size <= r:
print 'OK'
else:
print 'NA'
break
else:
i += 1
if i == 1:
t = [int(n) for n in line.split()]
t... | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s292204406 | p00107 | Runtime Error | from math import sqrt
cheeze = map(float,raw_input().split())
cheeze.sort()
supk = sqrt((cheeze[0]/2)**2 + (cheeze[1]/2)**2)
while True:
k = raw_input()
if k == "0 0 0": break
else:
k = int(k)
if k < supk: print "OK"
else: print "NA" | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s080246554 | p00107 | Runtime Error | import sys
from math import sqrt
nyu = sys.stdin.read()
nyu = nyu.split("\n")
cheese = map(float,nyu[0].split())
cheese.sort()
supk = sqrt((cheese[0]/2)**2 + (cheese[1]/2)**2)
nyu = map(int,nyu[2:])
try:
for k in nyu:
if k < supk: print "OK"
else: print "NA"
except:
pass | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s877883129 | p00107 | Runtime Error | import sys
from math import sqrt
nyu = sys.stdin.read()
nyu = nyu.split("\n")
cheese = map(float,nyu[0].split())
cheese.sort()
supk = sqrt((cheese[0]/2)**2 + (cheese[1]/2)**2)
nyu = map(int,nyu[2:-1])
try:
for k in nyu:
if k < supk: print "OK"
else: print "NA"
except:
pass | 10 6 8
5
4
8
6
2
5
0 0 0
| NA
OK
OK
NA
NA
|
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
s866638245 | p00108 | Wrong Answer | import sys
class ofa():
def cal(self,n):
list1=map(int,raw_input().split())
dic={}
#while True:
x=0
while True:
for i in range(n):
if list1[i] not in dic:
dic[list1[i]]=1
else :
dic[list1[i]]+=1
pre=list(list1)
for i in range(n):
for j in dic.keys():
if list1[... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s986909880 | p00108 | Wrong Answer | def f(x):
a=x
c=0
while 1:
A=list(set(a))
B=[a.count(e) for e in A]
b=[B[A.index(e)] for e in a]
if a==b: return c,a
a=b
c+=1
return
while 1:
n=input()
if n==0: break
c,x= f(map(int,raw_input().split()))
print c
for e in x: print e, | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s046241540 | p00108 | Wrong Answer | def make_count_dic(array):
dic = {}
for n in array:
if n not in dic:
dic[n] = 1
else:
dic[n] += 1
return dic
def make_new_array(array):
dic = make_count_dic(array)
new_array = []
for k in array:
new_array.append(dic[k])
return new_array ... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s549565255 | p00108 | Wrong Answer | def f(l,c):
m = [l.count(i) for i in l]
if l == m:
print(c)
m = [str(i) for i in m]
print(' '.join(m))
return
else:
c += 1
return f(m,c)
while True:
n = int(input())
if n == 0:
break
l = [i for i in input().split()]
f(l,0) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s805772825 | p00108 | Wrong Answer | def f(l,c):
m = [l.count(i) for i in l]
if l == m:
print(c)
m = [str(i) for i in m]
print(' '.join(m))
return
else:
c += 1
f(m,c)
while True:
n = int(input())
if n == 0:
break
l = [i for i in input().split()]
f(l,0) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s336575033 | p00108 | Wrong Answer | def f(l,c):
m = [l.count(i) for i in l]
c += 1
if l == m:
print(c-1)
m = [str(i) for i in m]
print(' '.join(m))
return
else:
f(m,c)
while True:
n = int(input())
if n == 0:
break
l = [i for i in input().split()]
f(l,0) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s703503732 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
s = []
u = 0
v = 0
s = list(input().split())
while True:
t = []
for i in range(n):
for j in range(n):
if s[i] == s[j]:
u += 1
t.append(u)
t_str = list(map(str, t))
u = 0
if s == t:
print(str(v))
print(" ".join(t_str))
break
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s817225247 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
s = []
u = 0
v = 0
s = list(input().split())
while True:
t = []
for i in range(n):
for j in range(n):
if s[i] == s[j]:
u += 1
t.append(u)
t_str = list(map(str, t))
u = 0
if s == t:
print(str(v))
print(" ".join(t_str))
break
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s187408666 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
pre = [S.count(s) for s in S]
cur = []
cnt = 1
while cnt < n:
cur = [pre.count(p) for p in pre]
if cur == pre:
break
pre = [c for c in cur]
cnt += 1
print... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s596236950 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
pre = [S.count(s) for s in S]
cur = []
cnt = 1
while cnt < n:
cur = [pre.count(p) for p in pre]
if cur == pre:
break
pre = [c for c in cur]
cnt += 1
print... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s096900998 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
pre, cur = [S.count(s) for s in S], []
cnt = 1
while True:
cur = [pre.count(p) for p in pre]
if cur == pre:
break
pre = [c for c in cur]
cnt += 1
print(cnt)
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s667169110 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
pre, cur = [S.count(s) for s in S], []
cnt = 1
while pre:
cur = [pre.count(p) for p in pre]
pre = 0 if cur == pre else cur[::]
cnt += 1
print(cnt-1)
print(' '.join(map(str, c... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s572227998 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
pre, cur = [S.count(s) for s in S], []
cnt = 0
while pre:
cur = [pre.count(p) for p in pre]
pre = 0 if cur == pre else cur[::]
cnt += 1
print(cnt)
print(' '.join(map(str, cur... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s672223762 | p00108 | Wrong Answer | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
pre, cur = [S.count(s) for s in S], []
cnt = 0
while pre:
cur = [pre.count(p) for p in pre]
pre = 0 if cur == pre else cur[::]
cnt += 1
print(str(cnt))
print(' '.join(map(str... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s267569925 | p00108 | Wrong Answer | while 1:
n=int(input())
if n==0:break
s=input().split()
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s128502133 | p00108 | Wrong Answer | while 1:
if'0'==input():break
s=input().split()
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s900531269 | p00108 | Wrong Answer | import sys
for a in sys.stdin:
if' 'in a:
s=list(map(int,a.split()))
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s358605561 | p00108 | Wrong Answer | import sys
for a in sys.stdin:
if' 'not in a:break
s=list(map(int,a.split()))
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s859929061 | p00108 | Wrong Answer | import sys
for a in sys.stdin:
if' 'in a:
s=list(map(int,a.strip().split()))
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s983347002 | p00108 | Wrong Answer | import sys
for a in sys.stdin:
if'0'not in a:
s=list(map(int,a.split()))
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s245581589 | p00108 | Wrong Answer | # AOJ 0108 Operation of Frequency of Appearance
# Python3 2018.6.18 bal4u
f = [0]*105
a = [[0 for j in range(15)] for i in range(2)]
while True:
n = int(input())
if n == 0: break
a[0] = list(map(int, input().split()))
a[1] = [0]*n
cnt = k1 = 0
while True:
for i in range(n): f[a[k1][i]] += 1
k2 = 1-k1
for i... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s491496990 | p00108 | Wrong Answer | while True:
n=input()
if n==0:
break
S=list(map(int,raw_input().split()))
pre,post=[],[]
cnt=0
for i in range(n):
post.append(S.count(S[i]))
while pre<>post:
pre=post[:]
post=[]
cnt+=1
for i in range(n):
post.append(pre.count(pre[i]... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s669901997 | p00108 | Wrong Answer | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from itertools import count
def main(readline=stdin.readline):
readline()
while 1:
ary = [int(s) for s in readline().split()]
if ary == [0]:
exit()
for case in count():
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s956146912 | p00108 | Wrong Answer | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from itertools import count
from collections import Counter
def main(readline=stdin.readline):
readline()
ran = Counter()
while 1:
ary = [int(s) for s in readline().split()]
if ary == [0]:
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s352326548 | p00108 | Wrong Answer | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from itertools import count
from collections import Counter
def main(readline=stdin.readline):
readline()
ran = Counter()
while 1:
ary = [int(s) for s in readline().split()]
if ary == [0]:
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s072293786 | p00108 | Wrong Answer | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit
from itertools import count
from collections import Counter
def main(readline=stdin.readline):
readline()
ran = Counter()
while 1:
ary = [int(s) for s in readline().split()]
if ary == [0]:
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s850098548 | p00108 | Wrong Answer | def foa(a):
b = a[:]
for i in range(len(b)):
b[i] = a.count(a[i])
if b == a:
return b
else:
return foa(b)
while True:
n = int(raw_input())
if n == 0:
break
a = map(int, raw_input().split())
print " ".join(map(str, foa(a))) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s463962841 | p00108 | Time Limit Exceeded | while True:
n = int(input())
if n == 0:
break
s = []
u = 0
v = 0
s = list(input().split())
while True:
t = []
for i in range(n):
for j in range(n):
if s[i] == s[j]:
u += 1
t.append(u)
t_str = list(map(str, t))
u = 0
if s == t_str:
print(str(v))
print(" ".join(t_str))
brea... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s295326891 | p00108 | Time Limit Exceeded | import sys
a=sys.stdin
while 1:
if'0'==a.readline():break
s=list(map(int,a.readline().split()))
c=0
while 1:
t=s;s=[t.count(e)for e in t]
if t==s:break
c+=1
print(c);print(*s)
| 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s576030848 | p00108 | Accepted | import sys
def _nextstep(s):
retval=[0 for i in range(len(s))]
for i,si in enumerate(s):
retval[i]=s.count(si)
return retval
def fudouten(s):
count=0
while True:
next=_nextstep(s)
if next==s:
return count,s
else:
s=next
count+=1
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s161062345 | p00108 | Accepted | while True:
n = int(input())
if n == 0:
break
else:
s = list(map(int, input().split(' ')))
times = 0
old_nums = [-1] * n
while old_nums != s:
new_nums = []
for i in s:
new_nums.append(s.count(i))
old_nums = s[::]
s = new_nums[::]
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s597402399 | p00108 | Accepted | while True:
n = input()
if n == 0:
break
S = map(int,raw_input().split())
S2 = [0] * n
num = 0
while True:
for i in range(n):
S2[i] = S.count(S[i])
if S2 == S:
break
else:
S, S2 = S2, S
num += 1
print num
for... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s886099823 | p00108 | Accepted | import sys
class ofa():
def cal(self,n):
list1=map(int,raw_input().split())
dic={}
#while True:
x=0
while True:
for i in range(n):
if list1[i] not in dic:
dic[list1[i]]=1
else :
dic[list1[i]]+=1
pre=list(list1)
for i in range(n):
for j in dic.keys():
if list1[... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s046864988 | p00108 | Accepted | def f(x):
a=x
c=0
while 1:
A=list(set(a))
B=[a.count(e) for e in A]
b=[B[A.index(e)] for e in a]
if a==b: return c,a
a=b
c+=1
return
while 1:
n=input()
if n==0: break
c,x= f(map(int,raw_input().split()))
print c
print " ".join(map(str,x)) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s450812856 | p00108 | Accepted | def f(x):
a,c=x,0
while 1:
b=[a.count(e) for e in a]
if a==b: return c," ".join(map(str,a))
else: a,c=b,c+1
while 1:
if input()==0: break
c,s=f(map(int,raw_input().split()))
print c; print s | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s917137712 | p00108 | Accepted | def f(x):
a=x; c=0
while 1:
b=[a.count(e) for e in a]
if a==b: return c," ".join(map(str,a))
else: a=b; c+=1
while 1:
if input()==0: break
c,s=f(map(int,raw_input().split()))
print c; print s | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s241894784 | p00108 | Accepted | while input()!=0:
a=map(int,raw_input().split())
c=0
while 1:
b=[a.count(e) for e in a]
if a==b: break
else: a=b; c+=1
print c
for e in a: print e,
print | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s748860344 | p00108 | Accepted | while input()!=0:
a=map(int,raw_input().split())
c=0
while 1:
b=[a.count(e) for e in a]
if a==b: break
else: a=b; c+=1
print c
print " ".join(map(str,a)) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s422294607 | p00108 | Accepted | while int(raw_input())!=0:
a=map(int,raw_input().split())
c=0
while 1:
b=[a.count(e) for e in a]
if a==b: break
else: a=b; c+=1
print c
print " ".join(map(str,a)) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s749973416 | p00108 | Accepted | while int(raw_input())!=0:
a = map(int, raw_input().split())
c = 0
while 1:
b = [a.count(e) for e in a]
if a==b: break
else: a=b; c+=1
print c
for e in a: print e,
print | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s380948787 | p00108 | Accepted | def f(a,c):
b = [a.count(e) for e in a]
if a!=b: b,c=f(b,c+1)
return b, c
while input()!=0:
a = map(int,raw_input().split())
a, c = f(a,0)
print c
print " ".join(map(str,a)) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s119075619 | p00108 | Accepted | def f(a,c):
b = [a.count(e) for e in a]
if a!=b: b,c=f(b,c+1)
return b, c
while int(raw_input())!=0:
a = map(int,raw_input().split())
a,c = f(a,0)
print c
print " ".join(map(str,a)) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s640205683 | p00108 | Accepted | def f(a, c):
b = [a.count(e) for e in a]
if a!=b:
b, c=f(b, c+1)
return b, c
while int(raw_input())!=0:
a = map(int, raw_input().split())
a, c = f(a,0)
print c
print " ".join(map(str, a)) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s784030086 | p00108 | Accepted | def getnewline(line,N):
newline=[0 for x in range(N)]
dnum={}
for x in line:
if x in dnum:
dnum[x]=dnum[x]+1
else:
dnum[x]=1
for i in range(N):
newline[i]=dnum[line[i]]
return newline
while(1):
N=int(raw_input())
if N==0:
break
els... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s211052595 | p00108 | Accepted | def count(n, ls, c = 0):
next_ls = [0]*n
for i in range(n):
next_ls[i] = ls.count(ls[i])
if ls == next_ls:
return c, ls
else:
return count(n, next_ls, c+1)
while True:
n = input()
if n == 0:
break
ls = map(int, raw_input().split())
a = count(n, ls)
prin... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s353154699 | p00108 | Accepted | while True:
n = input()
if n == 0: break
s = [int(x) for x in raw_input().split()]
cnt = 0
while True:
c = [0] * n
for i in range(n):
c[i] = s.count(s[i])
if s == c: break
else:
s = c
cnt += 1
print cnt
print " ".j... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s323531163 | p00108 | Accepted | def ocean(_S):
global S, count
count += 1
while _S:
a = _S[0]
n_S = []
c = 1
for v in _S[1:]:
if v == a:
c += 1
else:
n_S.append(v)
else:
dic[a] = str(c)
_S = n_S
else:
_S = []... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s976798907 | p00108 | Accepted | while True:
n = input()
if n == 0:
break
array = map(int,raw_input().split())
aray = []
count = 0
while array != aray:
aray = array
agency = []
for i in xrange(n):
agency.append(array.count(array[i]))
array = agency
count += 1
print count - 1
string = ""
for var in array:
string += str(... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s709712242 | p00108 | Accepted | while True:
n = int(input())
if n == 0:
break
a = [int(x) for x in input().split()]
cnt = 0
while True:
b = {}
for i in a:
if i in b:
b[i] += 1
else:
b[i] = 1
c = 0
for k, v in b.items():
if k... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s205076605 | p00108 | Accepted | while True:
n = int(input())
if n == 0:
break
s = []
u = 0
v = 0
s = list(map(int, input().split()))
while True:
t = []
for i in range(n):
for j in range(n):
if s[i] == s[j]:
u += 1
t.append(u)
t_str = list(map(str, t))
u = 0
if s == t:
print(str(v))
print(" ".join(t_str))
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s013688740 | p00108 | Accepted | def FOA(a, count):
b = [a.count(a[i]) for i in range(len(a))]
if b == a:
print(count)
print(" ".join(map(str, b)))
return
else:
return FOA(b, count+1)
while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
FOA(a, 0) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s170821224 | p00108 | Accepted | def FOA(a, count):
b = [a.count(a[i]) for i in range(len(a))]
if b == a:
print(count)
print(" ".join(map(str, b)))
else:
return FOA(b, count+1)
while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
FOA(a, 0) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s619546124 | p00108 | Accepted | while True:
n = int(input())
if n == 0:
break
Num_lis = list(map(int,input().split()))
New_lis = []
num = 0
while True:
for i in range(n):
New_lis.append(Num_lis.count(Num_lis[i]))
if Num_lis == New_lis:
break
num += 1
Num_lis = New... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s196045650 | p00108 | Accepted | def f(a,c):
b=[a.count(i) for i in a]
if b==a:print(c);print(' '.join(map(str,b)));return
f(b,c+1)
while 1:
n=int(input())
if not n:break
a=list(map(int,input().split()))
f(a,0) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s548408659 | p00108 | Accepted | while True:
n = int(input())
if n == 0:
break
S = list(map(int, input().split()))
cnt = 0
while S:
cur = [S.count(s) for s in S]
if cur == S:
break
cnt += 1
S = cur[::]
print(cnt)
print(' '.join(map(str, cur))) | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s541593620 | p00108 | Accepted | # -*- coding: utf-8 -*-
import sys
import os
import math
def freq_op(A):
B = []
for a in A:
B.append(A.count(a))
return B
for s in sys.stdin:
n = int(s)
if n == 0:
break
A = list(map(int, input().split()))
cnt = 0
while True:
B = freq_op(A)
cnt += 1
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s412140049 | p00108 | Accepted | import sys
from collections import Counter
def c2f(data):
num = 0
while True:
counter = Counter(data)
next = [counter[item] for item in data]
if data == next:
break
num += 1
data = next
return num, data
while True:
num = int(sys.stdin.readline())
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s843640277 | p00108 | Accepted | # Aizu Problem 0108: Operation of Frequency of Appearance
#
import sys, math, os
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
def operation_of_frequency_of_appearance(S):
S_old = S[:]
steps = 0
while True:
unique = list(set(S))
... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s027113074 | p00108 | Accepted | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0108
"""
import sys
from sys import stdin
input = stdin.readline
def main(args):
while True:
# S = [4, 5, 1, 1, 4, 5, 12, 3, 5, 4]
n = int(input())
if n == 0:
break
S = [int(x) for x i... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s758001979 | p00108 | Accepted | # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0108
AC
"""
import sys
from sys import stdin
input = stdin.readline
def main(args):
while True:
# S = [4, 5, 1, 1, 4, 5, 12, 3, 5, 4]
n = int(input())
if n == 0:
break
S = [int(x) for x... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s053088341 | p00108 | Accepted | while True:
n = int(input())
if n == 0:
break
a = list(map(int, input().split()))
b = []
cnt = 0
while True:
for m in a:
b.append(a.count(m))
if a == b:
break
cnt += 1
a = b
b = []
print(cnt)
print(' '.join(map(str,b... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
s694891768 | p00108 | Accepted | import sys
#from me.io import dup_file_stdin
#@dup_file_stdin
def solve():
while True:
n = int(sys.stdin.readline())
if n == 0 : return
a = list(map(int,sys.stdin.readline().split(' ')))
ops = 0
while True:
cnt = dict()
for x in a:
cnt... | 10
4 5 1 1 4 5 12 3 5 4
0
| 3
6 6 4 4 6 6 4 4 6 6
|
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>出現頻度操作</H1>
<p>
有限数列の変換操作に出現頻度操作というものがありま... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.