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 int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s396840794 | p00638 | u078042885 | 1485179060 | Python | Python3 | py | Accepted | 30 | 7676 | 220 | while 1:
n=int(input())
if n==0:break
a=[tuple(map(int,reversed(input().split()))) for _ in range(n)]
a.sort()
w=0
for x,y in a:
w+=y
if x<w:print('No');break
else:print('Yes') | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,678 |
s407359238 | p00638 | u227162786 | 1490097744 | Python | Python3 | py | Accepted | 30 | 7628 | 418 | while True:
n = int(input())
if n == 0:
break
bridges = []
for _ in range(n):
t, b = map(int, input().split())
bridges.append((t, b))
bridges.sort(key = lambda x: x[1])
flag = True
sumt = 0
for t, b in bridges:
sumt += t
if sumt > b:
f... | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,679 |
s316088733 | p00638 | u266872031 | 1499435998 | Python | Python | py | Accepted | 20 | 6292 | 370 | while(1):
n=int(raw_input())
if n==0: break
A=[[0,0] for i in range(n)]
for i in range(n):
[a,b]=map(int,raw_input().split())
A[i]=[a,b]
A.sort(key= lambda x: x[1])
s=0
for i in range(n):
if s+A[i][0]>A[i][1]:
print 'No'
break
else:
... | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,680 |
s581246171 | p00638 | u546285759 | 1508533407 | Python | Python3 | py | Accepted | 60 | 7680 | 305 | while True:
n = int(input())
if n == 0:
break
z = sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda x: x[1])
cnt = total = 0
for a, b in z:
total += a
if total > b:
break
cnt += 1
print("Yes" if cnt == n else "No") | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,681 |
s930198359 | p00638 | u546285759 | 1508533525 | Python | Python3 | py | Accepted | 40 | 7836 | 303 | while True:
n = int(input())
if n == 0:
break
z = sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda x: x[1])
cnt = total = 0
for a, b in z:
total += a
if total > b:
cnt = 1
break
print("No" if cnt else "Yes") | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,682 |
s234504487 | p00638 | u546285759 | 1508533627 | Python | Python3 | py | Accepted | 40 | 7752 | 298 | while True:
n = int(input())
if n == 0:
break
z = sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda x: x[1])
total = 0
for a, b in z:
total += a
if total > b:
print("No")
break
else:
print("Yes") | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,683 |
s035802508 | p00638 | u471400255 | 1530006255 | Python | Python3 | py | Accepted | 50 | 6284 | 529 | from sys import exit
from functools import reduce
from operator import add
def f(): return [int(i) for i in input().split()]
while True:
flag = False
n = int(input())
if not(n):
exit()
islands = []
for i in range(n):
islands.append(f())
islands.sort(key=lambda x:x[1])
w... | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,684 |
s193961431 | p00638 | u531592024 | 1530106186 | Python | Python3 | py | Accepted | 30 | 5616 | 421 | def sky(x):
return x[1]
while True:
n = int(input())
if n == 0:
break
arr = [[] for i in range(n)]
sumh = 0
for i in range(n):
arr[i] = list(map(int, input().split()))
arr.sort(key=sky)
res = True
for e in arr:
sumh += e[0]
if sumh > e[1]:
... | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,685 |
s880905182 | p00638 | u759949288 | 1352625336 | Python | Python | py | Accepted | 20 | 4252 | 237 | def solve(l):
have = 0
for m, w in l:
have += w
if m < have:
return "No"
return "Yes"
while True:
n = input()
if n == 0: break
l = [tuple(reversed(map(int, raw_input().split()))) for i in xrange(n)]
l.sort()
print solve(l) | p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,686 |
s124112328 | p00638 | u260980560 | 1583160531 | Python | Python3 | py | Accepted | 40 | 5620 | 317 | while 1:
N = int(input())
if N == 0:
break
P = [list(map(int, input().split())) for i in range(N)]
P.sort(key=lambda x: (-x[1], x[0]))
su = sum(w for w, s in P)
for w, s in P:
if s < su:
print("No")
break
su -= w
else:
print("Yes")
| p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,687 |
s742986320 | p00638 | u352394527 | 1544387360 | Python | Python3 | py | Accepted | 30 | 5612 | 256 | while True:
n = int(input())
if n == 0:
break
lst = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:x[-1])
acc = 0
for w, b in lst:
acc += w
if acc > b:
print("No")
break
else:
print("Yes")
| p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... | 3
2 3
3 6
1 2
3
2 3
3 5
1 2
0
| Yes
No
| 23,688 |
s737145528 | p00640 | u847467233 | 1530933030 | Python | Python3 | py | Accepted | 80 | 5660 | 820 | # AOJ 1054: Distorted Love
# Python3 2018.7.7 bal4u
while True:
n = int(input())
if n == 0: break
input() # w, h
pag, dic = [], {}
for i in range(n):
nm, k = input().split()
dic[nm] = i
btn = []
for j in range(int(k)):
x1, y1, x2, y2, bnm = input().split()
btn.append((int(x1), int(y1), int(x2), in... | p00640 |
<H1><font color="#000000">Problem D:</font> Distorted Love</H1>
<p>
Saying that it is not surprising that people want to know about their love, she has checked up his address, name, age, phone number, hometown, medical history, political party and even his sleeping position, every piece of his personal information. T... | 3
800 600
index 1
500 100 700 200 profile
profile 2
100 100 400 200 index
100 400 400 500 link
link 1
100 100 300 200 index
9
click 600 150
show
click 200 450
show
back
back
show
forward
show
0
| profile
link
index
profile
| 23,691 |
s880658946 | p00640 | u352394527 | 1547359971 | Python | Python3 | py | Accepted | 100 | 5688 | 1,856 | class Page:
def __init__(self, name, buttons):
self.name = name
self.buttons = buttons
class Button:
def __init__(self, line):
self.x1 = int(line[0])
self.y1 = int(line[1])
self.x2 = int(line[2])
self.y2 = int(line[3])
self.link = line[4]
class Buffer:... | p00640 |
<H1><font color="#000000">Problem D:</font> Distorted Love</H1>
<p>
Saying that it is not surprising that people want to know about their love, she has checked up his address, name, age, phone number, hometown, medical history, political party and even his sleeping position, every piece of his personal information. T... | 3
800 600
index 1
500 100 700 200 profile
profile 2
100 100 400 200 index
100 400 400 500 link
link 1
100 100 300 200 index
9
click 600 150
show
click 200 450
show
back
back
show
forward
show
0
| profile
link
index
profile
| 23,692 |
s564050683 | p00647 | u847467233 | 1531006478 | Python | Python3 | py | Accepted | 30 | 5608 | 656 | # AOJ 1062: It's our delight!!
# Python3 2018.6.8 bal4u
# 昼11:00-14:59, 夕18:00-20:59, 深夜21:00-01:59
tt = [[660, 899], [1080, 1259], [1260, 1559]]
ss = ["lunch", "dinner", "midnight"]
while True:
n = int(input())
if n == 0: break
cnt, ok = [0]*3, [0]*3
for i in range(n):
hm, MM = input().split()
hh, mm = map(i... | p00647 |
<h1>Problem A: It's our delight!!</h1>
<p>
You are a student of University of Aizu.
And you work part-time at a restaurant.
</p>
<p>
Staffs of the restaurant are well trained to be delighted to provide more delicious products faster.
</p>
<p>
The speed providing products particularly depends on skill of the staff.
S... | 5
12:57 59
20:12 15
12:19 21
18:52 03
16:09 14
0
| lunch 100
dinner 50
midnight no guest
| 23,693 |
s963231052 | p00647 | u078042885 | 1486348457 | Python | Python3 | py | Accepted | 30 | 7548 | 471 | while 1:
n=int(input())
if n==0:break
l=d=mi=cl=cm=cd=0
for i in range(n):
t,M=input().split()
M=int(M)
h,m=map(int,t.split(":"))
if m>M:M+=60
a=M-m<=8
if 11<=h<15:cl+=1;l+=a
elif 18<=h<21:cd+=1;d+=a
elif 21<=h or h< 2:cm+=1;mi+=a
print... | p00647 |
<h1>Problem A: It's our delight!!</h1>
<p>
You are a student of University of Aizu.
And you work part-time at a restaurant.
</p>
<p>
Staffs of the restaurant are well trained to be delighted to provide more delicious products faster.
</p>
<p>
The speed providing products particularly depends on skill of the staff.
S... | 5
12:57 59
20:12 15
12:19 21
18:52 03
16:09 14
0
| lunch 100
dinner 50
midnight no guest
| 23,694 |
s038856022 | p00647 | u104911888 | 1375359938 | Python | Python | py | Accepted | 20 | 4300 | 824 | while True:
n=input()
if n==0:break
Lok=Lng=Dok=Dng=Mok=Mng=0
for i in range(n):
temp=raw_input().split()
MM=int(temp[1])
hh,mm=map(int,temp[0].split(":"))
diff=MM-mm if MM-mm>=0 else MM-mm+60
if 11<=hh<15:
if diff<=8:
Lok+=1
... | p00647 |
<h1>Problem A: It's our delight!!</h1>
<p>
You are a student of University of Aizu.
And you work part-time at a restaurant.
</p>
<p>
Staffs of the restaurant are well trained to be delighted to provide more delicious products faster.
</p>
<p>
The speed providing products particularly depends on skill of the staff.
S... | 5
12:57 59
20:12 15
12:19 21
18:52 03
16:09 14
0
| lunch 100
dinner 50
midnight no guest
| 23,695 |
s330762843 | p00647 | u104911888 | 1375360389 | Python | Python | py | Accepted | 20 | 4288 | 787 | def addValue(ok,ng,diff):
if diff<=8:
ok+=1
else:
ng+=1
return ok,ng
while True:
n=input()
if n==0:break
Lok=Lng=Dok=Dng=Mok=Mng=0
for i in range(n):
temp=raw_input().split()
MM=int(temp[1])
hh,mm=map(int,temp[0].split(":"))
diff=MM-mm if MM-m... | p00647 |
<h1>Problem A: It's our delight!!</h1>
<p>
You are a student of University of Aizu.
And you work part-time at a restaurant.
</p>
<p>
Staffs of the restaurant are well trained to be delighted to provide more delicious products faster.
</p>
<p>
The speed providing products particularly depends on skill of the staff.
S... | 5
12:57 59
20:12 15
12:19 21
18:52 03
16:09 14
0
| lunch 100
dinner 50
midnight no guest
| 23,696 |
s293471331 | p00647 | u260980560 | 1583164254 | Python | Python3 | py | Accepted | 30 | 5596 | 750 | while 1:
N = int(input())
if N == 0:
break
a = b = c = 0
a0 = b0 = c0 = 0
for i in range(N):
s0, s1 = input().split()
h, m = map(int, s0.split(":"))
tm = 100*h + m
m1 = int(s1)
if m1 < m:
m1 += 60
if 1100 <= tm < 1500:
i... | p00647 |
<h1>Problem A: It's our delight!!</h1>
<p>
You are a student of University of Aizu.
And you work part-time at a restaurant.
</p>
<p>
Staffs of the restaurant are well trained to be delighted to provide more delicious products faster.
</p>
<p>
The speed providing products particularly depends on skill of the staff.
S... | 5
12:57 59
20:12 15
12:19 21
18:52 03
16:09 14
0
| lunch 100
dinner 50
midnight no guest
| 23,697 |
s424834684 | p00647 | u352394527 | 1544455533 | Python | Python3 | py | Accepted | 30 | 5684 | 800 | import math
while True:
n = int(input())
if n == 0:
break
name = ("lunch", "dinner", "midnight")
dic = {}
clear = {}
for s in name:
dic[s] = 0
clear[s] = 0
for _ in range(n):
start, time = input().split()
flag = (int(time) - int(start[3:])) % 60 <= 8
if "11:00" <= start <= "14:59":... | p00647 |
<h1>Problem A: It's our delight!!</h1>
<p>
You are a student of University of Aizu.
And you work part-time at a restaurant.
</p>
<p>
Staffs of the restaurant are well trained to be delighted to provide more delicious products faster.
</p>
<p>
The speed providing products particularly depends on skill of the staff.
S... | 5
12:57 59
20:12 15
12:19 21
18:52 03
16:09 14
0
| lunch 100
dinner 50
midnight no guest
| 23,698 |
s354491498 | p00650 | u847467233 | 1531172285 | Python | Python3 | py | Accepted | 60 | 5628 | 961 | # AOJ 1065 The House of Huge Family
# Python3 2018.7.10 bal4u
# UNION-FIND library
class UnionSet:
def __init__(self, nmax):
self.size = [1]*nmax
self.id = [i for i in range(nmax+1)]
def root(self, i):
while i != self.id[i]:
self.id[i] = self.id[self.id[i]]
i = self.id[i]
return i
def connected(self, ... | p00650 |
<H1>Problem D: The House of Huge Family</H1>
<p>
Mr. Dango's family has an extremely huge number of members.
Once it had about 100 members, and now it has as many as population of a city.
It is jokingly guessed that the member might fill this planet in the near future.
</p>
<p>
Mr. Dango's family, the huge family, is... | 3 2
0 1 2
1 2 1
2 1
0 1 100
2 1
0 1 0
2 1
0 1 -1
0 0
| 1
100
0
-1
| 23,699 |
s719568615 | p00657 | u847467233 | 1531209886 | Python | Python3 | py | Accepted | 30 | 5588 | 157 | # AOJ 1072: Rearranging Seats
# Python3 2018.7.10 bal4u
while True:
r, c = map(int, input().split())
if r == 0: break
print("no" if r*c & 1 else "yes")
| p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,700 |
s535496194 | p00657 | u078042885 | 1483244074 | Python | Python3 | py | Accepted | 30 | 7540 | 112 | while 1:
a,b=map(int,input().split())
if a==b==0: break
if a*b%2: print("no")
else: print("yes") | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,701 |
s471488348 | p00657 | u957028788 | 1502065501 | Python | Python3 | py | Accepted | 20 | 7640 | 138 | while True:
a,b = map(int, input().split())
if a == 0 and b == 0:
break
if a%2 == 0 or b%2 == 0:
print("yes")
else:
print("no") | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,702 |
s835842681 | p00657 | u104911888 | 1375357886 | Python | Python | py | Accepted | 20 | 4204 | 107 | while True:
r,c=map(int,raw_input().split())
if r==c==0:break
print "yes" if r*c%2==0 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,703 |
s084628872 | p00657 | u813384600 | 1380368353 | Python | Python | py | Accepted | 10 | 4208 | 164 | while True:
r, c = map(int, raw_input().split())
if (r,c) == (0,0):
break
if r%2!=0 and c%2!=0:
print 'no'
else:
print 'yes' | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,704 |
s001354820 | p00657 | u260980560 | 1385572091 | Python | Python | py | Accepted | 20 | 4188 | 117 | while 1:
r,c = map(int, raw_input().split())
if r==c==0: break
print "no" if r%2==1 and c%2==1 else "yes" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,705 |
s367558128 | p00657 | u633068244 | 1395163361 | Python | Python | py | Accepted | 10 | 4192 | 134 | while True:
r, c = map(int, raw_input().split())
if r == 0: break
print "yes" if (r > 1 or c > 1) and r*c%2 == 0 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,706 |
s005363896 | p00657 | u633068244 | 1395163521 | Python | Python | py | Accepted | 10 | 4184 | 112 | while True:
r, c = map(int, raw_input().split())
if r == 0: break
print "yes" if not r*c%2 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,707 |
s205967759 | p00657 | u633068244 | 1395163541 | Python | Python | py | Accepted | 10 | 4180 | 111 | while True:
r, c = map(int, raw_input().split())
if not r: break
print "yes" if not r*c%2 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,708 |
s291866064 | p00657 | u633068244 | 1395163595 | Python | Python | py | Accepted | 20 | 4180 | 107 | while 1:
r, c = map(int,raw_input().split())
if not r: break
print "yes" if not r*c%2 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,709 |
s517250963 | p00657 | u633068244 | 1395163610 | Python | Python | py | Accepted | 10 | 4184 | 107 | while 1:
r, c = map(int,raw_input().split())
if not r: break
print "yes" if not r*c%2 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,710 |
s103891361 | p00657 | u633068244 | 1395163786 | Python | Python | py | Accepted | 20 | 4188 | 101 | while 1:
r,c=map(int,raw_input().split())
if r==0:break
print "yes" if r*c%2==0 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,711 |
s811837078 | p00657 | u633068244 | 1395163817 | Python | Python | py | Accepted | 10 | 4184 | 101 | while 1:
r,c=map(int,raw_input().split())
if r==0:break
print "yes" if r*c%2==0 else "no" | p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,712 |
s662782823 | p00657 | u352394527 | 1544474885 | Python | Python3 | py | Accepted | 30 | 5596 | 110 | while True:
r, c = map(int, input().split())
if r == 0:
break
print(["yes", "no"][c % 2 and r % 2])
| p00657 |
<H1>Problem K: Rearranging Seats</H1>
<p>
Haruna is a high school student.
She must remember the seating arrangements in her class because she is a class president.
It is too difficult task to remember if there are so many students.
</p>
<p>
That is the reason why seating rearrangement is depress task for her.
But st... | 1 1
2 2
0 0
| no
yes
| 23,713 |
s595265098 | p00659 | u847467233 | 1531210940 | Python | Python3 | py | Accepted | 40 | 5624 | 411 | # AOJ 1074: Popularity Estimation
# Python3 2018.7.10 bal4u
while True:
n = int(input())
if n == 0: break
f, tbl = [0]*31, []
for i in range(n):
a = input().split()
nm = a.pop(0)
m = int(a.pop(0))
d = list(map(int, a))
tbl.append([0, nm, d])
for i in d: f[i] += 1
for i in range(n):
for j in tbl[i][2... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,714 |
s828467624 | p00659 | u553058997 | 1480500174 | Python | Python3 | py | Accepted | 40 | 7616 | 603 | while True:
try:
n = int(input())
except:
break
if n == 0: break
char = []
name = []
times = []
scores = {i: n + 1 for i in range(30)}
for i in range(n):
char = input().split()
name.append(char[0])
times.append(list(map(int, char[2:])))
... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,715 |
s576647278 | p00659 | u546285759 | 1490863628 | Python | Python3 | py | Accepted | 80 | 7852 | 694 | from itertools import combinations as C
while True:
n = int(input())
if n == 0: break
d, dd, ddd = {}, {}, {}
names = []
for i in range(n):
nmd = input().split()
d[nmd[0]] = nmd[2:]
names.append(nmd[0])
for cc in list(C(d.items(), n-1)):
t, tt = [], []
for... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,716 |
s055738850 | p00659 | u957028788 | 1502074173 | Python | Python3 | py | Accepted | 40 | 7716 | 1,048 | while True:
player_nun = int(input())
if player_nun == 0:
break
#?????????????????????
whole_data = []
for i in range(0, player_nun):
dat = input().split()
p_data = []
p_data.append(dat[0])
for x in dat[1:]:
p_data.append(int(x))
whole_data.append(p_data)
#??????????????????????????????????????... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,717 |
s968060216 | p00659 | u104911888 | 1373856436 | Python | Python | py | Accepted | 30 | 4268 | 591 | while True:
n=input()
if n==0:break
D=[raw_input().split() for i in range(n)]
D.sort()
L=[[False]*30 for i in range(n)]
P=[0]*n
for i in range(n):
for j in D[i][2:]:
L[i][int(j)]=True
for i in range(30):
cnt=0
for j in range(n):
if L[j][i]:... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,718 |
s459148426 | p00659 | u633068244 | 1396532839 | Python | Python | py | Accepted | 30 | 4248 | 343 | while 1:
n=input()
if n==0:break
p=[0]*n
l=[[0]*31 for i in range(n)]
a=sorted([raw_input().split() for i in range(n)])
for j in range(n):
for t in a[j][2:]:
l[j][int(t)]=1
for t in range(30):
c=0
for j in range(n):
if l[j][t]:
c+=1
for j in range(n):
if l[j][t]:
p[j]+=n-c+1
print min(p... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,719 |
s430682614 | p00659 | u633068244 | 1396532865 | Python | Python | py | Accepted | 30 | 4248 | 333 | while 1:
n=input()
if n==0:break
p=[0]*n
l=[[0]*31 for i in range(n)]
a=sorted([raw_input().split() for i in range(n)])
for j in range(n):
for t in a[j][2:]:
l[j][int(t)]=1
for t in range(30):
c=0
for j in range(n):
if l[j][t]:c+=1
for j in range(n):
if l[j][t]:p[j]+=n-c+1
print min(p),a[p.inde... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,720 |
s220384884 | p00659 | u260980560 | 1583252171 | Python | Python3 | py | Accepted | 40 | 5996 | 469 | from collections import defaultdict
while 1:
N = int(input())
if N == 0:
break
D = defaultdict(list)
S = [None]*N
for i in range(N):
name, _, *ts = input().split()
S[i] = name
for t in map(int, ts):
D[t].append(i)
P = [0]*N
for vs in D.values():
... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,721 |
s691145554 | p00659 | u352394527 | 1544681617 | Python | Python3 | py | Accepted | 40 | 6004 | 414 | from collections import defaultdict
while True:
n = int(input())
if n == 0:
break
score = {}
dic = defaultdict(list)
for _ in range(n):
line = input().split()
name = line[0]
score[name] = 0
for d in line[2:]:
dic[d].append(name)
for v in dic.values():
p = n - len(v) + 1
... | p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... | 4
akzakr 2 1 8
fnmyi 5 2 3 4 6 9
tsnukk 5 2 3 4 7 9
yskwcnt 6 3 4 7 8 9 10
4
akzakr 1 2
fnmyi 3 10 11 12
tsnukk 2 1 8
yskwcnt 2 1 8
5
knmmdk 2 13 19
akmhmr 4 13 15 19 22
mksyk 6 3 7 12 13 15 19
skrkyk 3 1 4 8
tmemm 3 1 17 24
5
knmmdk 5 5 6 16 18 26
akmhmr 9 3 4 7 11 14 15 17 18 20
mksyk 5 6 13 25 27 28
skrkyk 4 3 16 23... | 7 akzakr
4 akzakr
6 knmmdk
12 tmemm
19 iormns
24 mktkkc
| 23,722 |
s416860073 | p00660 | u352394527 | 1547370253 | Python | Python3 | py | Accepted | 70 | 5740 | 2,588 | class Surface:
def __init__(self, mp):
self.mp = mp
def mirror(self):
for y in range(5):
self.mp[y] = self.mp[y][::-1]
def mirror_ud(self):
for y in range(2):
self.mp[y], self.mp[4 - y] = self.mp[4 - y], self.mp[y]
def spin90(self):
new_mp = [[N... | p00660 |
<H1>Problem B: High & Low Cube</H1>
<p>
僕は近所の小学生たちと一緒に夏祭りに来ていた。有り体に言えば保護者役だが、出店の焼きそばやたこ焼きなんかが焼ける匂い、時折聞こえる打ち上げ花火の音などは、この歳になっても心が踊るものがある。が、好奇心旺盛な子供たちがはぐれないように、今日はしっかり見守っていないと。
</p>
<p>
子供たちはとある出店に興味を持ったようだった。覗き込んでみると、そこでは出店のおじさんとサイコロを使ったゲームをして、勝てば景品が貰えることになっていた。そのゲームは、 High & Low と呼ばれる単純なものだ。参加者とおじさんは1個ずつサイコロを振るが、その前... | .......#######......................#######..............
.......#.....#......................#..-..#..............
.......#.|...#......................#.|.|.#..............
.......#.....#......................#..-..#..............
.......#.|...#......................#.|...#..............
.......#..-..#................... | LOW
HIGH
HIGH
LOW
| 23,723 |
s150613322 | p00661 | u847467233 | 1531214425 | Python | Python3 | py | Accepted | 20 | 5604 | 187 | # AOJ 1076 Time Manipulation
# Python3 2018.7.10 bal4u
while True:
n, m = map(int, input().split())
if n == 0: break
p = list(map(int, input().split()))
if 1 in p: n = 0
print(n/2)
| p00661 |
<H1>Problem C: Time Manipulation</H1>
<p>
彼女は見習いの魔法使いだ。
彼女はまず最初に時間を操る魔法を覚えた。
そして彼女は生計を立たせるために酒屋を開くことにした。
彼女の住んでいる国の住人達はみんなお酒が大好き、ということが関係している。
住人達は長い年数をかけて熟成させたお酒が特に好きで、熟成させた年数に応じてその価値も比例して上がる。
50年熟成させたお酒より100年熟成させたお酒のほうが価値が高いのは簡単に想像がつくはずだ。
そして手に入れるのが難しいということも。
彼女は自分の魔法を使って、長い年月熟成させたお酒を一瞬で作って、それを売って収入を得ようとしているのであった... | 12 3
2 3 6
12 4
1 2 3 6
0 0
| 6.0000000000
0.0000000000
| 23,724 |
s147313721 | p00661 | u546285759 | 1491192636 | Python | Python3 | py | Accepted | 20 | 7668 | 204 | while True:
n, m = map(int, input().split())
if n == 0:
break
p = sorted(list(map(int, input().split())))
flag = 0 if p[0]==1 else 1
print('{:.10f}'.format(n/2 if flag else 0)) | p00661 |
<H1>Problem C: Time Manipulation</H1>
<p>
彼女は見習いの魔法使いだ。
彼女はまず最初に時間を操る魔法を覚えた。
そして彼女は生計を立たせるために酒屋を開くことにした。
彼女の住んでいる国の住人達はみんなお酒が大好き、ということが関係している。
住人達は長い年数をかけて熟成させたお酒が特に好きで、熟成させた年数に応じてその価値も比例して上がる。
50年熟成させたお酒より100年熟成させたお酒のほうが価値が高いのは簡単に想像がつくはずだ。
そして手に入れるのが難しいということも。
彼女は自分の魔法を使って、長い年月熟成させたお酒を一瞬で作って、それを売って収入を得ようとしているのであった... | 12 3
2 3 6
12 4
1 2 3 6
0 0
| 6.0000000000
0.0000000000
| 23,725 |
s066811867 | p00661 | u633068244 | 1399379872 | Python | Python | py | Accepted | 20 | 4224 | 132 | while 1:
n,m = map(int,raw_input().split())
if n == 0: break
p = min(map(int,raw_input().split()))
print n/2.0 if p > 1 else 0.0 | p00661 |
<H1>Problem C: Time Manipulation</H1>
<p>
彼女は見習いの魔法使いだ。
彼女はまず最初に時間を操る魔法を覚えた。
そして彼女は生計を立たせるために酒屋を開くことにした。
彼女の住んでいる国の住人達はみんなお酒が大好き、ということが関係している。
住人達は長い年数をかけて熟成させたお酒が特に好きで、熟成させた年数に応じてその価値も比例して上がる。
50年熟成させたお酒より100年熟成させたお酒のほうが価値が高いのは簡単に想像がつくはずだ。
そして手に入れるのが難しいということも。
彼女は自分の魔法を使って、長い年月熟成させたお酒を一瞬で作って、それを売って収入を得ようとしているのであった... | 12 3
2 3 6
12 4
1 2 3 6
0 0
| 6.0000000000
0.0000000000
| 23,726 |
s282895322 | p00663 | u847467233 | 1531220806 | Python | Python3 | py | Accepted | 90 | 5580 | 413 | # AOJ 1078: SAT-EN-3
# Python3 2018.7.10 bal4u
def clause(e):
f = True
dic = {}
f = e.split('&')
for x in f:
pm, t = 1, x[0]
if t == '~':
pm, t = -1, x[1]
if t in dic and dic[t] + pm == 0: f = False
dic[t] = pm
return f
while True:
p = input()
if p == '#': break
exp = list(p.split('|'))
ans = Fals... | p00663 |
<H1>Problem E: SAT-EN-3</H1>
<p>
彼女は悩んでいた。成績が良くないのだ。両親に無理を言って全寮制の学校に入学したものの、彼女の才能は一向に開花することはなかった。あるいは才能など元々なかったのかもしれないが、それはできるだけ考えたくない可能性だった。
</p>
<p>
そこで彼女が頼ったのは、インターネット上で見つけた怪しげな脳力トレーニングの教材だった。SAT-EN-3 (SATisifiability problem for Enhancement of Neuron: version 3) と銘打つその学習メソッドによると、充足可能性問題のようなもののインスタンスをひたすら手で解くことに... | (B&B&f)|(~d&~i&i)|(~v&i&~V)|(~g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i&~V)|(~v&f&~d)
(S&X&~X)
#
| yes
no
| 23,727 |
s083631906 | p00663 | u144532944 | 1531418770 | Python | Python3 | py | Accepted | 80 | 5580 | 634 | while True:
s = input().strip()
if s == '#': break
clauses = s.split('|')
for clause in clauses:
literals = clause[1:-1].split('&')
ntil = clause.count('~')
if ntil == 0 or ntil == 3:
print('yes')
break
if ntil == 1:
x = [v[1] for v in... | p00663 |
<H1>Problem E: SAT-EN-3</H1>
<p>
彼女は悩んでいた。成績が良くないのだ。両親に無理を言って全寮制の学校に入学したものの、彼女の才能は一向に開花することはなかった。あるいは才能など元々なかったのかもしれないが、それはできるだけ考えたくない可能性だった。
</p>
<p>
そこで彼女が頼ったのは、インターネット上で見つけた怪しげな脳力トレーニングの教材だった。SAT-EN-3 (SATisifiability problem for Enhancement of Neuron: version 3) と銘打つその学習メソッドによると、充足可能性問題のようなもののインスタンスをひたすら手で解くことに... | (B&B&f)|(~d&~i&i)|(~v&i&~V)|(~g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i&~V)|(~v&f&~d)
(S&X&~X)
#
| yes
no
| 23,728 |
s274591929 | p00663 | u633068244 | 1397008891 | Python | Python | py | Accepted | 70 | 4216 | 283 | while 1:
exps=raw_input().split("|")
if exps[0]=="#":break
for i in range(len(exps)):
v=True
lits=exps[i][1:-1].split("&")
for lit1 in lits:
for lit2 in lits:
if (lit1=="~"+lit2) or ("~"+lit1==lit2):
v=False
if v:
print "yes"
break
else:
print "no"
| p00663 |
<H1>Problem E: SAT-EN-3</H1>
<p>
彼女は悩んでいた。成績が良くないのだ。両親に無理を言って全寮制の学校に入学したものの、彼女の才能は一向に開花することはなかった。あるいは才能など元々なかったのかもしれないが、それはできるだけ考えたくない可能性だった。
</p>
<p>
そこで彼女が頼ったのは、インターネット上で見つけた怪しげな脳力トレーニングの教材だった。SAT-EN-3 (SATisifiability problem for Enhancement of Neuron: version 3) と銘打つその学習メソッドによると、充足可能性問題のようなもののインスタンスをひたすら手で解くことに... | (B&B&f)|(~d&~i&i)|(~v&i&~V)|(~g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i&~V)|(~v&f&~d)
(S&X&~X)
#
| yes
no
| 23,729 |
s125961000 | p00663 | u633068244 | 1397009189 | Python | Python | py | Accepted | 60 | 4224 | 275 | while 1:
exps=raw_input().split("|")
if exps[0]=="#":break
for exp in exps:
v=1
lit=exp[1:-1].split("&")
for i in range(2):
for j in range(i+1,3):
if (lit[i]=="~"+lit[j]) or ("~"+lit[i]==lit[j]):
v=0
if v:
print "yes"
break
else:
print "no"
| p00663 |
<H1>Problem E: SAT-EN-3</H1>
<p>
彼女は悩んでいた。成績が良くないのだ。両親に無理を言って全寮制の学校に入学したものの、彼女の才能は一向に開花することはなかった。あるいは才能など元々なかったのかもしれないが、それはできるだけ考えたくない可能性だった。
</p>
<p>
そこで彼女が頼ったのは、インターネット上で見つけた怪しげな脳力トレーニングの教材だった。SAT-EN-3 (SATisifiability problem for Enhancement of Neuron: version 3) と銘打つその学習メソッドによると、充足可能性問題のようなもののインスタンスをひたすら手で解くことに... | (B&B&f)|(~d&~i&i)|(~v&i&~V)|(~g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i&~V)|(~v&f&~d)
(S&X&~X)
#
| yes
no
| 23,730 |
s199553702 | p00663 | u352394527 | 1547377717 | Python | Python3 | py | Accepted | 70 | 5576 | 365 | while True:
s = input()
if s == "#":
break
clauses = s.split("|")
for clause in clauses:
literals = set(clause[1:-1].split("&"))
for literal in literals:
if literal[0] == "~" and literal[1] in literals:
break
else:
print("yes")
... | p00663 |
<H1>Problem E: SAT-EN-3</H1>
<p>
彼女は悩んでいた。成績が良くないのだ。両親に無理を言って全寮制の学校に入学したものの、彼女の才能は一向に開花することはなかった。あるいは才能など元々なかったのかもしれないが、それはできるだけ考えたくない可能性だった。
</p>
<p>
そこで彼女が頼ったのは、インターネット上で見つけた怪しげな脳力トレーニングの教材だった。SAT-EN-3 (SATisifiability problem for Enhancement of Neuron: version 3) と銘打つその学習メソッドによると、充足可能性問題のようなもののインスタンスをひたすら手で解くことに... | (B&B&f)|(~d&~i&i)|(~v&i&~V)|(~g&~e&o)|(~f&d&~v)|(d&~i&o)|(g&i&~B)|(~i&f&d)|(e&~i&~V)|(~v&f&~d)
(S&X&~X)
#
| yes
no
| 23,731 |
s114790874 | p00676 | u827448139 | 1417434255 | Python | Python3 | py | Accepted | 40 | 6800 | 185 | import sys
for line in sys.stdin:
a,l,x=map(float,line.split())
center=1/2*a*(l**2-(a/2)**2)**0.5
side=1/2*l*(((l+x)/2)**2-(l/2)**2)**0.5
print("{0:.10f}".format(center+side*2)) | p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,732 |
s828893464 | p00676 | u827448139 | 1417434830 | Python | Python3 | py | Accepted | 40 | 6804 | 108 | import sys
for s in sys.stdin:
a,l,x=map(float,s.split())
print(a/2*(l*l-a*a/4)**.5+l/2*(2*l*x+x*x)**.5) | p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,733 |
s810275087 | p00676 | u827448139 | 1417435283 | Python | Python3 | py | Accepted | 40 | 6796 | 103 | import sys
for s in sys.stdin:a,l,x=map(float,s.split());print(a/2*(l*l-a*a/4)**.5+l/2*(2*l*x+x*x)**.5) | p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,734 |
s201130908 | p00676 | u609255173 | 1352576117 | Python | Python | py | Accepted | 20 | 4400 | 292 | from sys import stdin
from math import sqrt
def area(a, b, c):
d = (a + b + c) / 2.0
return sqrt(d * (d - a) * (d - b) * (d - c))
for line in stdin:
(a, l, x) = map(int, line.split())
print "%.6f" % (area(a, l, l) + 2 * area(l, (l + x) / 2.0, (l + x) / 2.0)) | p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,735 |
s705421229 | p00676 | u104911888 | 1369473201 | Python | Python | py | Accepted | 20 | 4404 | 228 | import math
while True:
try:
a,l,x=map(int,raw_input().split())
except EOFError:
break
ADC=math.sqrt(pow((l+x)/2.0,2)-pow(l/2.0,2))*l/2
ABC=math.sqrt(pow(l,2)-pow(a/2.0,2))*a/2
print ABC+2*ADC | p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,736 |
s934014875 | p00676 | u633068244 | 1395244122 | Python | Python | py | Accepted | 20 | 4384 | 214 | import math
def S(a,b):
s = b+a/2.0
return math.sqrt(s*(s-a)*(s-b)**2)
while True:
try:
a,l,x = map(int, raw_input().split())
print S(a,l)+2*S(l,(l+x)/2.0)
except:
break | p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,737 |
s141018721 | p00676 | u240091169 | 1590906853 | Python | Python3 | py | Accepted | 50 | 5692 | 272 | import math
while True :
try :
a, l, x = map(int, input().split())
except EOFError :
break
HC = math.sqrt(l**2 - a**2 / 4)
I = math.sqrt(((l+x)/2)**2 - l**2 / 4)
S1 = a * HC / 2
S2 = l * I / 2
print('{:.8f}'.format(S1 + S2*2))
| p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,738 |
s874131492 | p00676 | u260980560 | 1583420412 | Python | Python3 | py | Accepted | 50 | 5676 | 183 | from math import sqrt
try:
while 1:
a, l, x = map(int, input().split())
print("%.10f" % (l*sqrt(x*(2*l+x))/2 + a*sqrt(4*l**2 - a**2)/4))
except EOFError:
...
| p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,739 |
s893171229 | p00676 | u348629392 | 1568205811 | Python | Python3 | py | Accepted | 50 | 5680 | 274 | import math
while True:
try:
a,l,x=map(int, input().split())
temp=(l+x)/2
except EOFError:
break
def heron(i,j,k):
d = (i+j+k)/2
return math.sqrt(d*(d-i)*(d-j)*(d-k))
print((str(heron(a,l,l)+heron(l,temp,temp)*2)))
| p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,740 |
s437978046 | p00676 | u466986881 | 1568201712 | Python | Python | py | Accepted | 20 | 4732 | 218 | import math
while True:
try:
a,l,x=map(int,raw_input().split())
except EOFError:
break
ANS=math.sqrt(pow(l,2)-pow(a/2.0,2))*a/2+math.sqrt(pow((l+x)/2.0,2)-pow(l/2.0,2))*l/2*2
print ANS
| p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,741 |
s264400133 | p00676 | u352394527 | 1545054842 | Python | Python3 | py | Accepted | 60 | 5664 | 264 | while True:
try:
a, l, x = map(int, input().split())
except EOFError:
break
s1 = (l + l + x) / 2
v1 = (s1 * (l / 2) * (l / 2) * (x / 2)) ** (1 / 2)
s2 = (l + l + a) / 2
v2 = (s2 * (s2 - l) * (s2 - l) * (s2 - a)) ** (1 / 2)
print(v1 * 2 + v2)
| p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,742 |
s506892332 | p00676 | u539753516 | 1534082199 | Python | Python3 | py | Accepted | 40 | 5732 | 116 | import sys
for i in sys.stdin:
a,l,x=map(int,i.split())
print((a*(4*l*l-a*a)**.5+2*l*((l+x)**2-l*l)**.5)/4)
| p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... | 2 2 1
2 3 1
3 2 3
2 3 5
| 3.9681187851
6.7970540913
6.5668891783
13.9527248554
| 23,743 |
s348606089 | p00682 | u847467233 | 1531507617 | Python | Python3 | py | Accepted | 30 | 6400 | 562 | # AOJ 1100: Area of Polygons
# Python3 2018.7.14 bal4u
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
def calc_area(pp):
n = len(pp)
if n < 3: return 0
s = 0
for i in range(n):
s += (pp[i].real-pp[(i+1)%n].real)*(pp[i].imag+pp[(i+1)%n].imag)
return abs(s)/2
cno = 0
while True:
n = input()
if n ... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,744 |
s754602749 | p00682 | u847467233 | 1531508115 | Python | Python3 | py | Accepted | 40 | 6388 | 469 | # AOJ 1100: Area of Polygons
# Python3 2018.7.14 bal4u
from decimal import Decimal, ROUND_HALF_UP
def calc_area(pp):
n, s = len(pp), 0
for i in range(n): s += (pp[i].real-pp[(i+1)%n].real)*(pp[i].imag+pp[(i+1)%n].imag)
return abs(s)/2
cno = 0
while True:
n = int(input())
if n == 0: break
pp = [complex(*map(int... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,745 |
s377902101 | p00682 | u296492699 | 1404747814 | Python | Python | py | Accepted | 20 | 4256 | 355 | c=0
while True:
n=input()
if n==0:
break
c+=1
x0, y0=map(int,raw_input().split())
prev_x, prev_y=x0, y0
tmp=0
for i in range(n-1):
x,y=map(int,raw_input().split())
tmp+=prev_x*y - prev_y*x
prev_x, prev_y=x, y
tmp+=prev_x*y0 - prev_y*x0
print c, 0.5*abs... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,746 |
s940946551 | p00682 | u180584272 | 1427117909 | Python | Python | py | Accepted | 60 | 6008 | 14,591 | from math import sqrt,fabs,ceil,floor,pow,exp,log,sin,cos,tan,asin,acos,atan,atan2,pi
import copy
inf=float("inf")
class Real:
isLineLike=False
eps=1e-10
def __init__(self,x):
self.x=float(x)
def __float__(self):
return self.x
def __repr__(self):
return str(self.x)
def __eq__(self,other):
return abs( ... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,747 |
s866769519 | p00682 | u797673668 | 1454144065 | Python | Python3 | py | Accepted | 30 | 7640 | 374 | num = 1
while True:
n = int(input())
if not n:
break
x0, y0 = map(float, input().split())
prx, pry = x0, y0
area = 0
for _ in range(n - 1):
x, y = map(float, input().split())
area += (prx * y - x * pry)
prx, pry = x, y
area += (prx * y0 - x0 * pry)
area /... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,748 |
s547407626 | p00682 | u685815919 | 1474447276 | Python | Python | py | Accepted | 10 | 6348 | 301 | q = 1
while True:
n = int(raw_input())
if n == 0: break
x = [0] * n
y = [0] * n
for i in xrange(n):
x[i],y[i] = map(float, raw_input().split())
S = 0
for i in xrange(n):
S += x[i]*y[(i+1)%n] - x[(i+1)%n]*y[i]
if S < 0: S = -S
print "%d %.1f" % (q, S/2)
q += 1
raw_input() | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,749 |
s042431237 | p00682 | u367408485 | 1479257066 | Python | Python3 | py | Accepted | 20 | 7684 | 646 | from os import sys
n = int(input())
c = 1
while True:
if n == 0:
sys.exit(0)
X = 0
Y = 0
ox = 0
oy = 0
esquerda = 0
direita = 0
for i in range(0,n):
cx, cy = input().split(' ')
cx = int(cx)
cy = int(cy)
if i == 0:
X = cx
Y =... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,750 |
s147078381 | p00682 | u078042885 | 1484636197 | Python | Python3 | py | Accepted | 20 | 7616 | 262 | c=0
while 1:
n=int(input())
if n==0:break
c+=1
p=[complex(*map(int,input().split())) for _ in range(n)]
s,pre=0,p[0]
while p:
now=p.pop()
s+=now.real*pre.imag-now.imag*pre.real
pre=now
print(c,abs(s)/2);input() | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,751 |
s854312088 | p00682 | u901080241 | 1489382794 | Python | Python3 | py | Accepted | 20 | 7576 | 346 | idx = 1
while True:
n = int(input())
if n==0: break
x = []
y = []
for _ in range(n):
a,b = map(int,input().split())
x.append(a)
y.append(b)
x.append(x[0])
y.append(y[0])
s = 0.0
for i in range(n):
s += x[i]*y[i+1] - x[i+1]*y[i]
print(idx, abs(s/2)... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,752 |
s888535029 | p00682 | u266872031 | 1500215835 | Python | Python | py | Accepted | 30 | 6440 | 1,605 | def convex(Pset):
v1=[Pset[1][0]-Pset[0][0],Pset[1][1]-Pset[0][1]]
v2=[Pset[2][0]-Pset[1][0],Pset[2][1]-Pset[1][1]]
v3=[Pset[2][0]-Pset[0][0],Pset[2][1]-Pset[0][1]]
c= v1[0]*v2[1]-v1[1]*v2[0]
return c
def area(Pset):
v1=[Pset[1][0]-Pset[0][0],Pset[1][1]-Pset[0][1]]
v2=[Pset[2][0]-Pset[1][0]... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,753 |
s416431534 | p00682 | u181768286 | 1513647441 | Python | Python | py | Accepted | 10 | 4720 | 413 | # coding: utf-8
def mul(p1, p2):
return (p1[0] - p2[0]) * (p1[1] + p2[1]) * 1.0
n = input()
cnt = 1
while n != 0:
data = []
for i in range(n):
data.append(map(int, raw_input().split()))
data.append(data[0])
areaSum = 0.0
for i in range(n):
areaSum = areaSum + mul(data[i],data... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,754 |
s813026140 | p00682 | u343390141 | 1515386697 | Python | Python3 | py | Accepted | 30 | 5620 | 527 | index = 1
while True:
n = int(input())
if n == 0:
break
else:
area = 0
X = []
Y = []
for i in range(n):
x, y = map(int, input().split())
X.append(x)
Y.append(y)
for i in range(1, n-1):
area += ((X[i] - X[0]) * (... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,755 |
s216510419 | p00682 | u114315703 | 1523127741 | Python | Python3 | py | Accepted | 30 | 5620 | 474 |
def shoelace(A):
ret = 0
for idx in range(1, len(A)):
left = A[idx - 1]
right = A[idx]
ret += left[0] * right[1] - left[1] * right[0]
ret += A[-1][0] * A[0][1] - A[-1][1] * A[0][0]
return abs(ret) / 2
index = 1
while True:
N = int(input())
if N == 0:
break
... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,756 |
s440638060 | p00682 | u724548524 | 1527746317 | Python | Python3 | py | Accepted | 20 | 5616 | 292 | def cp(a, b):return a[0] * b[1] - a[1] * b[0]
c = 1
while 1:
n = int(input())
if n == 0:break
p = [tuple(map(int, input().split())) for _ in range(n)]
input()
s = 0
for i in range(n):s += cp(p[i], p[i - 1])
s = abs(s / 2)
print("{} {}".format(c,s))
c += 1
| p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,757 |
s457467911 | p00682 | u089116225 | 1529509341 | Python | Python3 | py | Accepted | 30 | 5632 | 533 | def area(p,q,r):
a = [x-y for x,y in zip(r,p)]
b = [x-y for x,y in zip(q,p)]
return (a[0]*b[1]-a[1]*b[0]) / 2
S = []
while True:
string = input()
if string == '':
continue
elif int(string) == 0:
break
else:
n = int(string)
v = []
for _ in range(n):
... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,758 |
s021913031 | p00682 | u104911888 | 1369181662 | Python | Python | py | Accepted | 10 | 4260 | 262 | cnt=1
while True:
n=input()
if n==0:break
data=[map(int,raw_input().split()) for i in range(n)]
data.append(data[0])
print cnt,sum((data[i][0]-data[i+1][0])*(data[i][1]+data[i+1][1]) for i in \
range(n))/(-2.0)
cnt+=1
skip=raw_input() | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,759 |
s256037939 | p00682 | u536245846 | 1374655222 | Python | Python | py | Accepted | 10 | 4260 | 321 | c = 0
while True:
c += 1
n = raw_input()
if n == "0":
break
l = []
for i in xrange(int(n)):
l.append(map(float, raw_input().split()))
raw_input()
a = 0
tmp = l[-1]
for i in l:
a += (i[1]+tmp[1])*(i[0]-tmp[0])/2.0
tmp = i
print "{0} {1}".format(c, a... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,760 |
s324532624 | p00682 | u454358619 | 1376818489 | Python | Python | py | Accepted | 10 | 4260 | 262 | cnt=1
while True:
n=input()
if n==0:break
data=[map(int,raw_input().split()) for i in range(n)]
data.append(data[0])
print cnt,sum((data[i][0]-data[i+1][0])*(data[i][1]+data[i+1][1]) for i in \
range(n))/(-2.0)
cnt+=1
skip=raw_input() | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,761 |
s433175826 | p00682 | u300645821 | 1392607405 | Python | Python | py | Accepted | 20 | 4300 | 457 | cross=lambda a1, b1, a2, b2: a1*b2-a2*b1
try:
T=0
while True:
T+=1
n=int(raw_input())
if n==0: break
a=[[float(e) for e in raw_input().split()] for i in range(n)]
s=0
t=0
for i in range(n-1):
x=cross(a[i][0],a[i][1],a[i+1][0],a[i+1][1])
if x>0: s+=abs(x)/2
else: t+=abs(x)/2
x=cross(a[n-1][0],... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,762 |
s057723078 | p00682 | u633068244 | 1399381142 | Python | Python | py | Accepted | 10 | 4240 | 222 | c = 1
while 1:
n = input()
if n == 0: break
xy = [map(int,raw_input().split()) for i in range(n)]
xy.append(xy[0])
print c,abs(sum(xy[i][0]*xy[i+1][1] - xy[i+1][0]*xy[i][1] for i in range(n)))/2.0
c += 1
raw_input() | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,763 |
s421907652 | p00682 | u300645821 | 1400580827 | Python | Python3 | py | Accepted | 30 | 6780 | 511 | import sys
if sys.version_info[0]>=3: raw_input=input
cross=lambda a1, b1, a2, b2: a1*b2-a2*b1
try:
T=0
while True:
T+=1
n=int(raw_input())
if n==0: break
a=[[float(e) for e in raw_input().split()] for i in range(n)]
s=0
t=0
for i in range(n-1):
x=cross(a[i][0],a[i][1],a[i+1][0],a[i+1][1])
if x>0:... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,764 |
s198394015 | p00682 | u300645821 | 1400580865 | Python | Python | py | Accepted | 20 | 4308 | 511 | import sys
if sys.version_info[0]>=3: raw_input=input
cross=lambda a1, b1, a2, b2: a1*b2-a2*b1
try:
T=0
while True:
T+=1
n=int(raw_input())
if n==0: break
a=[[float(e) for e in raw_input().split()] for i in range(n)]
s=0
t=0
for i in range(n-1):
x=cross(a[i][0],a[i][1],a[i+1][0],a[i+1][1])
if x>0:... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,765 |
s362583637 | p00682 | u816190432 | 1595156902 | Python | Python3 | py | Accepted | 30 | 5620 | 293 | def cal(a,b):
return a[0]*b[1]-a[1]*b[0]
c=1
while 1:
N=int(input())
if N==0:
break
p=[tuple(map(int, input().split())) for _ in range(N)]
input()
S=0
for i in range(N):
S += cal(p[i],p[i-1])
S=abs(S/2)
print("{} {}".format(c,S))
c+=1
| p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,766 |
s713369695 | p00682 | u528682978 | 1561266963 | Python | Python3 | py | Accepted | 30 | 5616 | 429 | def area(px,py,x,y):
if py > y:
py,y = y,py
return py*(x-px)+(x-px)*abs(y-py)/2
count = 1
while True:
res = 0
n = int(input())
if n == 0:
break
px,py = map(int,input().split())
sx,sy = px,py
for _ in range(n-1):
x,y = map(int,input().split())
res += area(... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,767 |
s165648632 | p00682 | u316584871 | 1553391839 | Python | Python3 | py | Accepted | 20 | 5612 | 589 | def det(a,b):
return a[0]*b[1] - a[1]*b[0]
cnt = 1
while True :
n = int(input())
if n==0:
break
dots = []
std = list(map(int,input().split()))
for i in range(n-1):
dots.append(list(map(int,input().split())))
#print(dots)
dots2 = []
for dot in dots:
dot[0] ... | p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... | 3
1 1
3 4
6 0
7
0 0
10 10
0 20
10 30
0 40
100 40
100 0
0
| 1 8.5
2 3800.0
| 23,768 |
s152327175 | p00684 | u847467233 | 1531511530 | Python | Python3 | py | Accepted | 70 | 5664 | 1,364 | # AOJ 1102: Calculation of Expressions
# Python3 2018.7.14 bal4u
OVER = 10000
def factor():
global w, pos
if buf[pos] == '(':
pos += 1
f, v1 = calc()
if not f: return [f, 0]
pos += 1
elif buf[pos] == 'i':
pos += 1
v1 = complex(0, 1)
else:
v1 = 0
while pos < w and buf[pos].isdigit():
v1 = 10*v1 ... | p00684 |
<H1>Calculation of Expressions</H1>
<P>Write a program to calculate values of arithmetic expressions which may
involve complex numbers. Details of the expressions are described below.</P>
<P>In this problem, basic elements of expressions are
non-negative integer numbers and
the special symbol "<TT>i</TT>"... | (1-10*i)+00007+(3+10*i)
3+4*i*(4+10*i)
(102+10*i)*(99+10*i)
2*i+3+9999*i+4
| 11
-37+16i
9998+2010i
overflow
| 23,778 |
s681329470 | p00684 | u816190432 | 1595163353 | Python | Python3 | py | Accepted | 70 | 5664 | 1,297 | OVER = 10000
def factor():
global w, pos
if buf[pos] == '(':
pos += 1
f, v1 = calc()
if not f: return [f, 0]
pos += 1
elif buf[pos] == 'i':
pos += 1
v1 = complex(0, 1)
else:
v1 = 0
while pos < w and buf[pos].isdigit():
v1 = 10*v1 + int(buf[pos])
pos += 1
if v1 > OVER: return [False, 0]
re... | p00684 |
<H1>Calculation of Expressions</H1>
<P>Write a program to calculate values of arithmetic expressions which may
involve complex numbers. Details of the expressions are described below.</P>
<P>In this problem, basic elements of expressions are
non-negative integer numbers and
the special symbol "<TT>i</TT>"... | (1-10*i)+00007+(3+10*i)
3+4*i*(4+10*i)
(102+10*i)*(99+10*i)
2*i+3+9999*i+4
| 11
-37+16i
9998+2010i
overflow
| 23,779 |
s439106705 | p00686 | u847467233 | 1531523144 | Python | Python3 | py | Accepted | 40 | 5624 | 677 | # AOJ 1104: Where's Your Robot?
# Python3 2018.7.14 bal4u
# N,E,S,W -> 0,1,2,3
f = [[0,1],[1,0],[0,-1],[-1,0]]
b = [[0,-1],[-1,0],[0,1],[1,0]]
while True:
w, h = map(int, input().split())
if w == 0: break
r, c, d = 1, 1, 0
while True:
buf = input().split()
if buf[0] == "STOP": break
elif buf[0] == "RIGHT"... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,783 |
s962737875 | p00686 | u901080241 | 1489651054 | Python | Python3 | py | Accepted | 40 | 7640 | 900 | def numchange(boo):
if boo:return 1
else: return -1
while True:
m,n = map(int,input().split())
if m==0: break
yaxis = 1
xaxis = 1
rotation = 0
while True:
lnr = input()
if lnr == "STOP": break
elif lnr == "RIGHT": rotation = (rotation+1)%4
elif lnr == "L... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,784 |
s435487892 | p00686 | u797673668 | 1490617270 | Python | Python3 | py | Accepted | 40 | 7792 | 788 | moves = [
{'F': lambda i, j, x: (i, min(n, j + x)), 'B': lambda i, j, x: (i, max(1, j - x))},
{'F': lambda i, j, x: (min(m, i + x), j), 'B': lambda i, j, x: (max(1, i - x), j)},
{'F': lambda i, j, x: (i, max(1, j - x)), 'B': lambda i, j, x: (i, min(n, j + x))},
{'F': lambda i, j, x: (max(1, i - x), j), ... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,785 |
s803498870 | p00686 | u343390141 | 1515389003 | Python | Python3 | py | Accepted | 40 | 5620 | 1,977 | while True:
col, row = map(int, input().split())
if col == 0:
break
else:
robot = [1, 1]
direction = "up"
while True:
str = input()
if str == "STOP":
print(robot[0], robot[1])
break
elif str == "LEFT":
... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,786 |
s408251888 | p00686 | u104911888 | 1371959539 | Python | Python | py | Accepted | 20 | 4280 | 765 | while True:
w,h=map(int,raw_input().split())
if w==h==0:break
mv=((0,1),(1,0),(0,-1),(-1,0))
pos=0
nx=ny=1
while True:
command=raw_input()
if command=="STOP":
break
if command[-1].isdigit():
d,l=command.split()
if d=="FORWARD":
... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,787 |
s238883825 | p00686 | u633068244 | 1399381832 | Python | Python | py | Accepted | 20 | 4252 | 437 | def go(n,x,dx,l):
return min(n,max(1,x+l*dx))
while 1:
m,n = map(int,raw_input().split())
if m == 0: break
x = y = 1
dx,dy = 0,1
while 1:
com = raw_input().split()
s = com[0][0]
if s == "S": break
elif s == "F":
l = int(com[1])
x,y = go(m,x,dx,l), go(n,y,dy,l)
elif s == "B":
l = int(com[1])
... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,788 |
s008534403 | p00686 | u633068244 | 1399382075 | Python | Python | py | Accepted | 20 | 4232 | 353 | while 1:
m,n = map(int,raw_input().split())
if m == 0: break
x = y = 1
dx,dy = 0,1
while 1:
com = raw_input().split()
s = com[0][0]
if s == "S": break
elif s == "R":
dx,dy = dy,-dx
elif s == "L":
dx,dy = -dy,dx
else:
d = 1 if s == "F" else -1
l = d*int(com[1])
x,y = min(m,max(1,x+l*dx)... | p00686 |
<h1>
Where's Your Robot?</h1>
<p>
You have full control over a robot that walks around in a rectangular
field paved with square tiles like a chessboard. There are <i>m</i>
columns of tiles from west to east, and <i>n</i> rows of tiles from
south to north (1 <= <i>m, n</i> <= 100). Each tile is given a pair
of coord... | 6 5
FORWARD 3
RIGHT
FORWARD 5
LEFT
BACKWARD 2
STOP
3 1
FORWARD 2
STOP
0 0
| 6 2
1 1
| 23,789 |
s903601214 | p00688 | u847467233 | 1531602362 | Python | Python3 | py | Accepted | 50 | 5680 | 586 | # AOJ 1106: Factorization of Quadratic Formula
# Python3 2018.7.15 bal4u
def gcd(a, b):
while b != 0:
r = a % b
a, b = b, r
return a
while True:
a, b, c = map(int, input().split())
if a == 0: break
d = b**2-4*a*c
if d < 0: print("Impossible"); continue
d = d**0.5
if not d.is_integer(): print("Impossible")... | p00688 |
<h1>
Factorization of Quadratic Formula</h1>
<p>As the first step in algebra, students learn quadratic formulas and
their factorization. Often, the factorization is a severe burden
for them. A large number of students cannot master the factorization;
such students cannot be aware of the elegance of advanced algebra... | 2 5 2
1 1 1
10 -7 0
1 0 -3
0 0 0
| 2 1 1 2
Impossible
10 -7 1 0
Impossible
| 23,790 |
s916027948 | p00688 | u266872031 | 1434283872 | Python | Python | py | Accepted | 30 | 4432 | 940 | import math
def getgcd(a,b):
[a,b]=[min(a,b),max(a,b)]
aa=a
bb=b
while aa!=0:
[aa,bb]=[bb%aa,aa]
return bb
while(1):
[a,b,c]=[int(x) for x in raw_input().split()]
if a==0:
break
else:
bunbo=2*a
if b**2-4*a*c<0:
print 'Impossible'
else... | p00688 |
<h1>
Factorization of Quadratic Formula</h1>
<p>As the first step in algebra, students learn quadratic formulas and
their factorization. Often, the factorization is a severe burden
for them. A large number of students cannot master the factorization;
such students cannot be aware of the elegance of advanced algebra... | 2 5 2
1 1 1
10 -7 0
1 0 -3
0 0 0
| 2 1 1 2
Impossible
10 -7 1 0
Impossible
| 23,791 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.