output_description stringlengths 15 956 | submission_id stringlengths 10 10 | status stringclasses 3 values | problem_id stringlengths 6 6 | input_description stringlengths 9 2.55k | attempt stringlengths 1 13.7k | problem_description stringlengths 7 5.24k | samples stringlengths 2 2.72k |
|---|---|---|---|---|---|---|---|
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s647647206 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | D,N=map(int.input()split())
if N<100:
print(pow(100,D)*N)
else:
print(pow(100,D)*101) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s726603251 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B= map(int, input().split())
if A<=8 and B<=8;
print('Yay!')
else:
print(':(') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s636052571 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int, input().split())
if a<= 8 and b <= 8:
print("Yay!")
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s453939653 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | numA numB = input()
if(numA <=8 and numB <= 8):
print('Yay!')
else:
print(':(')
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s072504533 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int, input().split())
ans=′Yay!′
if a>=9 or b>=9:
ans=′:(′
print(ans) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s031876210 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a ,b = map(int,input().split())
if a =< 8 and b=<8:
print("Yay")
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s889907731 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B=map(int,input().split())
if 'A<9) and (B<9):
print('Yay!')
else:
print(':)') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s955649730 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | D,N=map(int,input()split())
if N<100:
print(pow(100,D)*N)
else:
print(pow(100,D)*101)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s690799408 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int,input().split())
if
if a>9 and b>9:
print(":(")
else:
print("yay!") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s229108111 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int, input().split())
if a > 8 && b > 8 :
print (":(")
elif
print ("Yay!") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s167884274 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int, input().split())
ans=′Yay!′
if a>9 or b>9:
ans=′:(′
print(ans) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s738488189 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | N = int(input())
li = list(map(int, input().split()))
a = 0
while any(j % 2 == 0 for j in li):
for i in range(N):
if li[i] % 2 == 0:
li[i] = li[i] / 2
a += 1
break
print(a)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s119545107 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A, B = map(int, input().split())
count = 0
for i in range(16):
if count == 0:
A -= 1
else:
B -= 1
if A <= 0 and B <= 0:
print(Yay!)
else:
print(:() | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s269316930 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = map(int, input().split())
List = [list(map(int, input().split())) for i in range(a)]
newList = []
for i in range(0, a):
n = 0
for j in range(0, 3):
n = n + List[i][j]
newList.append(n)
x = sorted(newList, reverse=True)
m = 0
for i in range(0, b):
m = m + x[i]
print(m)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s382063498 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | d, n = map(int, input().split())
if d == 0:
if n == 100:
print(101)
else:
print(n)
else:
if n == 100:
print(100**d * n)
else:
print(100**d * 101) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s952078835 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = map(int,input().split()))
if a >= 8:
print(:()
elif b >= 8:
print(:()
else:
print(Yay!) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s306564707 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = map(int, input().split())
if a < b:
tmp = a
a = b
b = tmp
r = 16 - 2a
b = b - a
if r // 2 >= b:
print('Yay!')
else:
print(':') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s538319972 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = map(int,input().split()))
if a => 8:
print(:()
elif b => 8:
print(:()
else:
print(Yay!) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s321029630 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | line = input()
num_a, num_b = [int(n) for n in line.split()][0]
is_it_possible = "Yay!"
if num_a > 8 or num_b > 8:
is_it_possible = ":("
print(is_it_possible)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s682955935 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a = int(input())
b = int(input())
if a<=8 and b<=8 :
print("Yay!")
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s557947870 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | 4545454
5455454
4
4545
44444444444444444444444444440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000044444
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s596694427 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | #coding:utf-8
import sys
input_nums = [int(x) for x in split(readline())]
if len(input_num) > 2 :
sys.exit("illegal input")
if (sum(input_nums)) > 16:
sys.exit("illegal input")
if (min(input_nums)) < 1:
sys.exit("illegal input")
if (max_num = max(input_nums)) > 16:
sys.exit("illegal input")
elif max_num > 8:
print(":(")
else :
print('Yay!') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s033200920 | Wrong Answer | p03323 | Input is given from Standard Input in the following format:
A B | # print("please, type A and B")
ab_list = input().split()
A_cake = int(ab_list[0])
B_cake = int(ab_list[1])
if (not 1 <= A_cake <= 16) or (not 1 <= B_cake <= 16) or (A_cake + B_cake > 16):
print("something is wrong with your input")
print("A:" + str(A_cake))
print("B:" + str(B_cake))
exit()
Acnt = A_cake
Bcnt = B_cake
for i in range(16):
if Acnt <= 0:
Bcnt -= 1
continue
elif Bcnt <= 0:
Acnt -= 1
continue
elif i % 2 == 0:
Acnt -= 1
continue
else:
Bcnt -= 1
continue
if Acnt <= 0 and Bcnt <= 0:
print("Yay!")
else:
print(":)")
print(Acnt)
print(Bcnt)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s271262426 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | import java.util.*;
import static java.lang.System.*;
import java.lang.Math;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int C = 0;
if (A < B) {
C = 16 - A * 2;
if (C / 2 >= (B - A)) {
out.print("Yay!");
}else{
out.print(":(");
}
} else if (A > B) {
C = 16 - B * 2;
if (C / 2 >= (A - B)) {
out.print("Yay!");
}else{
out.print(":(");
}
} else {
if (A <= 8 && B <= 8) {
out.print("Yay!");
}else{
out.print(":(");
}
}
}
}
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s057799822 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | xs = map(int, input().split())
test = all(x <= 8 for x in xs)
print("Yay!" if test else ":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s591644175 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A, B = (int(i) for i in input().split())
if A =< 8 and B =< 8:
print('yay!')
else:
print(':(') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s204033194 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A, B = map( int, input().split())
if( abs(A - B) == 1):
print('yey!)
else:
print(':(') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s107574624 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B = map(int, input().split())
if A < = 8 and B <= 8:
print("Yay!")
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s043731823 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B = map(int, input().split())
if if A-B <=1 or B-A <=1:
print("Yay!")
else:
print(":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s339512584 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = [int i for i in input().split()]
if a <= 8 and b <= 8:
print("Yay!")
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s484942175 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a = map(int,input().split())
if a[0] >9:
print(":(")
elif a[1] >9:
print(":(")
else:
print(""Yay!) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s002600081 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A, B = list(map(int, input().split()))
if(A > 8 and B > 8)
print(':(')
else
print('Yey!')
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s406306418 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | print("Yay!" if all(map(lambda num: int(num) <= 8, input().split())) else ":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s134735095 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | n = [int(i) for i in input().split(" ")]
print("Yay!" if n[0] <= 8 and n[1] <= 8 else ":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s790386771 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B= map(int, input().split())
if A<=8 and B<=8:
print(Yay!)
else:
print(:() | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s287902831 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A, B = map(int,input().split())
if A<9 AND B<9:
print('Yay!')
else:
print(':(') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s055095642 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = map(int, input().split())
print([':(', 'Yay!'][int((a <= 16) & (b <= 8)])
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s493063565 | Wrong Answer | p03323 | Input is given from Standard Input in the following format:
A B | D, N = list(map(int, input().split()))
b = 10**D
a = b * N
print(a)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s296905027 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a=input()
b=input()
if a<=8&&b<=8:
print("Yay!")
else:
print(":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s578002998 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int,input().split())
if a > 8 || b > 8:
print(':(")
else:
print('Yay!') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s543648782 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B=map(int,input().split())
if A<=8 and B<=8:
print("Yay!")
ekse:
print(":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s551396339 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A - Happy Birthday! | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s393645518 | Wrong Answer | p03323 | Input is given from Standard Input in the following format:
A B | print(1)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s610944204 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | print("Yay!" if max(map(int, input().split())) < "9" else ":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s513836230 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b=map(int,input.split())
if a<9&&b<9:
print("Yay!")
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s687165036 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B=map(int,input().split())
print("Yay!" if A<=8 and B<=8 ":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s385403803 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b=map(int,input().split()):print('Yay!' if max(a,b)<=8 else ':(') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s473710740 | Wrong Answer | p03323 | Input is given from Standard Input in the following format:
A B | print("yey!" if max(list(map(int, input().split()))) < 9 else ":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s506732504 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | D,N=map(int,input().split())
print((100**D)*N if N<100 else print((N+1)*(100+D)) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s663963584 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b=map(int,input().split())
if a<8 && b<8:
print("Yay!")
else:
print(":)") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s369220613 | Wrong Answer | p03323 | Input is given from Standard Input in the following format:
A B | 'x = int(input())\n\nprint(x)\n\nprint("Hello World!")'
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s325478804 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | D,N=map(int,input()split())
if N<100:
print(100**D*N)
else:
print(100**D*101)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s924640996 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b = map(int,input().split())
if a>9 0r b>9:
print(":(")
else:
print("yay!") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s043559634 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = map(int, input().split())
print("Yay!") if a <= 8 and b <= 8 else print(":(
")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s766883472 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | import math
import itertools
line = input().split()
n = int(line[0])
m = int(line[1])
values = []
for i in range(n):
values.append(list(map(int, input().split())))
mx = 0
for c in list(itertools.combinations(range(n), m)):
x = 0
y = 0
z = 0
for i in range(len(c)):
x += values[c[i]][0]
y += values[c[i]][1]
z += values[c[i]][2]
s = abs(x) + abs(y) + abs(z)
if s > mx:
mx = s
print(mx)
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s692085826 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A, B = map(int, input().split())
max = 8
if A <= max && B <= max:
print("Yay!")
else:
print(":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s354541854 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | # -*- coding: utf-8 -*-
a,b = map(int,input().split())
if a >= 8 o r b >= 8:
print(":(")
else:
print("Yay!")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s375511974 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | print(["Yay!", ":(", ":("][sum([int(i) // 9 for i in input().split()])])
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s592295836 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | t = input()
print(["Yay!", ":("][len(t) > 3 or "9" in t])
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s391296552 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | print(":Y(a y !"[eval(input().replace(" ", "<9>")) :: 2])
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s191958963 | Accepted | p03323 | Input is given from Standard Input in the following format:
A B | print("Yay!" if max([int(i) for i in input().split()]) <= 8 else ":(")
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s923201577 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b=map(int,input().split());print("Y:a(y !"[a>8or8<b::2]) | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s877849848 | Wrong Answer | p03323 | Input is given from Standard Input in the following format:
A B | D, N = map(int, open(0).read().split())
print((N + N // 100) * (100**D))
| Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s052849316 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a,b=list(map(int,input().split()))
print('Yey!' if (a<=8&&b<=8) else ':(') | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s808705526 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A = input()
B = input()
if A < 9 and B < 9:
print(Yay!)
else:
print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s509864577 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | x,y=map(int,input().split(" "))
if(x<=8 && y<=8) print("Yay!")
else print(":(") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s629230331 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | A,B=map(int,input().split())
if A<=8:
print(Yay!)
if B<=8:
print(:() | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s435314763 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | 11 4 | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If both E869120 and square1001 can obey the instruction in the note and take
desired numbers of pieces of cake, print `Yay!`; otherwise, print `:(`.
* * * | s791885274 | Runtime Error | p03323 | Input is given from Standard Input in the following format:
A B | a, b = int(input())
print("Yay!") if a <= 8 and b <= 8 else print(":(
") | Statement
E869120's and square1001's 16-th birthday is coming soon.
Takahashi from AtCoder Kingdom gave them a round cake cut into 16 equal fan-
shaped pieces.
E869120 and square1001 were just about to eat A and B of those pieces,
respectively,
when they found a note attached to the cake saying that "the same person
should not take two adjacent pieces of cake".
Can both of them obey the instruction in the note and take desired numbers of
pieces of cake? | [{"input": "5 4", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "8 8", "output": "Yay!\n \n\nBoth of them can take desired number of pieces as follows: \n\n* * *"}, {"input": "11 4", "output": ":(\n \n\nIn this case, there is no way for them to take desired number of pieces,\nunfortunately."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s315852833 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | s = str(input())
if s[1] = "A" and [s[3], s[-2] ].count("C") == 1 :
s[1] = a
s[3] = a
s[-2] = a
a = ""
for i in s:
a = a + s
if a.islower() :
print("AC")
else:
print("WA")
else:
print("WA") | Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s133105623 | Accepted | p03289 | Input is given from Standard Input in the following format:
S | a = input()
b = a[1:].replace("C", "")
c = b.lower()
print(["WA", "AC"][a[0] == "A" and a[2:-1].count("C") == 1 and b == c])
| Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s441063447 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | S = input()
flag = False
if S.startswith("A"):
if ((S[2]) == "C") ^ (S["-2"]=="C"):
index = S.find("C")
for i, s in enumerate(S):
if (i == 0) or (i == index):
continue
if s.islower():
print(AC)
else:
print(WA) | Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s888813370 | Wrong Answer | p03289 | Input is given from Standard Input in the following format:
S | s = str(input())
f = s[0] == "A" and s[2:-1].count("C") == 1
g = (s[:2] + s[2:-1].replace("A", "a").replace("C", "c") + s[-1]).islower()
h = f and g
print("AC" if h is True else "WA")
| Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s032940033 | Wrong Answer | p03289 | Input is given from Standard Input in the following format:
S | print("Yes")
| Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s609629882 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | S=input()
flag=False
if S[0]=="A":
if S[2:-1].count("C")==1:
pos=S.find("C")
T=S[1:pos]+S[pos+1:]
if T.islower():
print("AC")
flag=True
if flag=False:
print("WA") | Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s037185492 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | S=input()
C1=S[0]=='A' and S[-1].islower()
C1=C1 and S[1].islower()
C2=0
C3=0
for i in S[2:len(S)-1]:
if i=='C':
C2+=1
elif i.islower():
else:
C3+=1
if C1 and C2==1 and C3==0:
print('AC')
else:
print('WA')
| Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s973595352 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | s=input()
result=""
count=0
l=len(s)
for i in range(l):
if i==0 and s[i]="A":
result="WA"
break
elif i==1 and ord(s[1])<97
result="WA"
break
elif i==l-1 and ord(s[l-1])<97:
result="WA"
break
else:
if ord(i)<97:
count+=1
if count>1:
result="WA"
break
if result!="WA"
result="AC"
print(result)
| Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s912286546 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | s = list(input())
if len(s)
if (s[0] == "A") and (s[2:-2].count("C")==1):
print("aa")
s[0] = "a"
s[s[2:-2].index("C")+2] = "c"
l = list()
for i in range(len(s)):
l.append(s[i].lower())
#(s,l)
if s == l:
print("AC")
exit()
print("WA") | Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s799886671 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | S = list(input())
if S[0] != 'A':
print("WC")
exit()
c_count = 0
upper_count = 0
for i in range(len(S)):
if S[i] == 'C':
if (i < 2) | (i > (len(S)-1)):
print("WC")
exit()
else:
if c_count == 0:
c_count += 1
else:
print("WA")
exit()
if S[i].isupper():
upper_count++
if (c_count == 1) & (upper_count == 2):
print("AC") | Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
If S satisfies all of the conditions in the problem statement, print `AC`;
otherwise, print `WA`.
* * * | s665715639 | Runtime Error | p03289 | Input is given from Standard Input in the following format:
S | s = input()
check = 0
if s[0] == "A":
if s[2:len(s)-1].count("C") == 1:
if s[1].lower() == s[1] and s[len(s)-1].lower() == s[len(s)-1]:
s.lstrip("C")
if s[1:len(s)].lower() == s[1:len(s)]:
check = 1
if check = 0:
print("WA")
else:
print("AC")
| Statement
You are given a string S. Each character of S is uppercase or lowercase
English letter. Determine if S satisfies all of the following conditions:
* The initial character of S is an uppercase `A`.
* There is exactly one occurrence of `C` between the third character from the beginning and the second to last character (inclusive).
* All letters except the `A` and `C` mentioned above are lowercase. | [{"input": "AtCoder", "output": "AC\n \n\nThe first letter is `A`, the third letter is `C` and the remaining letters are\nall lowercase, so all the conditions are satisfied.\n\n* * *"}, {"input": "ACoder", "output": "WA\n \n\nThe second letter should not be `C`.\n\n* * *"}, {"input": "AcycliC", "output": "WA\n \n\nThe last letter should not be `C`, either.\n\n* * *"}, {"input": "AtCoCo", "output": "WA\n \n\nThere should not be two or more occurrences of `C`.\n\n* * *"}, {"input": "Atcoder", "output": "WA\n \n\nThe number of `C` should not be zero, either."}] |
Print the average length of the paths. Your output will be judges as correct
when the absolute difference from the judge's output is at most 10^{-6}.
* * * | s559976001 | Accepted | p02861 | Input is given from Standard Input in the following format:
N
x_1 y_1
:
x_N y_N | # row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()
# row = [int(input().rstrip()) for _ in range(n)]
def resolve():
import sys
input = sys.stdin.readline
n = int(input().rstrip())
cities = [[int(x) for x in input().rstrip().split(" ")] for _ in range(n)]
import math
import itertools
length_list = []
p = itertools.permutations(list(range(n)), n)
for v in p:
length = 0
for city_i in range(n - 1):
city1 = cities[v[city_i]]
city2 = cities[v[city_i + 1]]
length += math.sqrt((city1[0] - city2[0]) ** 2 + (city1[1] - city2[1]) ** 2)
length_list.append(length)
print(sum(length_list) / len(length_list))
if __name__ == "__main__":
resolve()
| Statement
There are N towns in a coordinate plane. Town i is located at coordinates
(x_i, y_i). The distance between Town i and Town j is \sqrt{\left(x_i-
x_j\right)^2+\left(y_i-y_j\right)^2}.
There are N! possible paths to visit all of these towns once. Let the length
of a path be the distance covered when we start at the first town in the path,
visit the second, third, \dots, towns, and arrive at the last town (assume
that we travel in a straight line from a town to another). Compute the average
length of these N! paths. | [{"input": "3\n 0 0\n 1 0\n 0 1", "output": "2.2761423749\n \n\nThere are six paths to visit the towns: 1 \u2192 2 \u2192 3, 1 \u2192 3 \u2192 2, 2 \u2192 1 \u2192 3, 2 \u2192 3\n\u2192 1, 3 \u2192 1 \u2192 2, and 3 \u2192 2 \u2192 1.\n\nThe length of the path 1 \u2192 2 \u2192 3 is\n\\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} +\n\\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the\naverage length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6}\n= 2.276142...\n\n* * *"}, {"input": "2\n -879 981\n -866 890", "output": "91.9238815543\n \n\nThere are two paths to visit the towns: 1 \u2192 2 and 2 \u2192 1. These paths have the\nsame length.\n\n* * *"}, {"input": "8\n -406 10\n 512 859\n 494 362\n -955 -475\n 128 553\n -986 -885\n 763 77\n 449 310", "output": "7641.9817824387"}] |
Print the average length of the paths. Your output will be judges as correct
when the absolute difference from the judge's output is at most 10^{-6}.
* * * | s417658382 | Wrong Answer | p02861 | Input is given from Standard Input in the following format:
N
x_1 y_1
:
x_N y_N | n = int(input())
a = [list(map(int, input().split())) for i in range(n)]
x = 0
y = 1
for i in a:
for j in a:
x += pow((i[0] - j[0]) ** 2 + (i[1] - j[1]) ** 2, 0.5)
for k in range(1, n + 1):
y *= k
print(x / y)
| Statement
There are N towns in a coordinate plane. Town i is located at coordinates
(x_i, y_i). The distance between Town i and Town j is \sqrt{\left(x_i-
x_j\right)^2+\left(y_i-y_j\right)^2}.
There are N! possible paths to visit all of these towns once. Let the length
of a path be the distance covered when we start at the first town in the path,
visit the second, third, \dots, towns, and arrive at the last town (assume
that we travel in a straight line from a town to another). Compute the average
length of these N! paths. | [{"input": "3\n 0 0\n 1 0\n 0 1", "output": "2.2761423749\n \n\nThere are six paths to visit the towns: 1 \u2192 2 \u2192 3, 1 \u2192 3 \u2192 2, 2 \u2192 1 \u2192 3, 2 \u2192 3\n\u2192 1, 3 \u2192 1 \u2192 2, and 3 \u2192 2 \u2192 1.\n\nThe length of the path 1 \u2192 2 \u2192 3 is\n\\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} +\n\\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the\naverage length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6}\n= 2.276142...\n\n* * *"}, {"input": "2\n -879 981\n -866 890", "output": "91.9238815543\n \n\nThere are two paths to visit the towns: 1 \u2192 2 and 2 \u2192 1. These paths have the\nsame length.\n\n* * *"}, {"input": "8\n -406 10\n 512 859\n 494 362\n -955 -475\n 128 553\n -986 -885\n 763 77\n 449 310", "output": "7641.9817824387"}] |
Print the average length of the paths. Your output will be judges as correct
when the absolute difference from the judge's output is at most 10^{-6}.
* * * | s730865964 | Accepted | p02861 | Input is given from Standard Input in the following format:
N
x_1 y_1
:
x_N y_N | n, *z = [list(map(int, t.split())) for t in open(0)]
print(sum(((a - x) ** 2 + (b - y) ** 2) ** 0.5 for a, b in z for x, y in z) / n[0])
| Statement
There are N towns in a coordinate plane. Town i is located at coordinates
(x_i, y_i). The distance between Town i and Town j is \sqrt{\left(x_i-
x_j\right)^2+\left(y_i-y_j\right)^2}.
There are N! possible paths to visit all of these towns once. Let the length
of a path be the distance covered when we start at the first town in the path,
visit the second, third, \dots, towns, and arrive at the last town (assume
that we travel in a straight line from a town to another). Compute the average
length of these N! paths. | [{"input": "3\n 0 0\n 1 0\n 0 1", "output": "2.2761423749\n \n\nThere are six paths to visit the towns: 1 \u2192 2 \u2192 3, 1 \u2192 3 \u2192 2, 2 \u2192 1 \u2192 3, 2 \u2192 3\n\u2192 1, 3 \u2192 1 \u2192 2, and 3 \u2192 2 \u2192 1.\n\nThe length of the path 1 \u2192 2 \u2192 3 is\n\\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} +\n\\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the\naverage length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6}\n= 2.276142...\n\n* * *"}, {"input": "2\n -879 981\n -866 890", "output": "91.9238815543\n \n\nThere are two paths to visit the towns: 1 \u2192 2 and 2 \u2192 1. These paths have the\nsame length.\n\n* * *"}, {"input": "8\n -406 10\n 512 859\n 494 362\n -955 -475\n 128 553\n -986 -885\n 763 77\n 449 310", "output": "7641.9817824387"}] |
Print the average length of the paths. Your output will be judges as correct
when the absolute difference from the judge's output is at most 10^{-6}.
* * * | s301180137 | Accepted | p02861 | Input is given from Standard Input in the following format:
N
x_1 y_1
:
x_N y_N | N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
entHai = []
def newHai(preHai, hai):
global entHai
if len(hai) == 1:
entHai.append(preHai + hai)
# print(hai)
for h in hai:
narr = [na for na in hai if na != h]
# print("narr:",narr)
narr = newHai(preHai + [h], narr)
# print("narR:",narr)
newHai([], list(range(N)))
keiroSum = 0
for eh in entHai:
# print(eh)
for nn in range(1, N):
xi, yi = xy[eh[nn - 1]]
xj, yj = xy[eh[nn]]
keiroSum += pow((xi - xj) ** 2 + (yi - yj) ** 2, 0.5)
print(keiroSum / len(entHai))
| Statement
There are N towns in a coordinate plane. Town i is located at coordinates
(x_i, y_i). The distance between Town i and Town j is \sqrt{\left(x_i-
x_j\right)^2+\left(y_i-y_j\right)^2}.
There are N! possible paths to visit all of these towns once. Let the length
of a path be the distance covered when we start at the first town in the path,
visit the second, third, \dots, towns, and arrive at the last town (assume
that we travel in a straight line from a town to another). Compute the average
length of these N! paths. | [{"input": "3\n 0 0\n 1 0\n 0 1", "output": "2.2761423749\n \n\nThere are six paths to visit the towns: 1 \u2192 2 \u2192 3, 1 \u2192 3 \u2192 2, 2 \u2192 1 \u2192 3, 2 \u2192 3\n\u2192 1, 3 \u2192 1 \u2192 2, and 3 \u2192 2 \u2192 1.\n\nThe length of the path 1 \u2192 2 \u2192 3 is\n\\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} +\n\\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the\naverage length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6}\n= 2.276142...\n\n* * *"}, {"input": "2\n -879 981\n -866 890", "output": "91.9238815543\n \n\nThere are two paths to visit the towns: 1 \u2192 2 and 2 \u2192 1. These paths have the\nsame length.\n\n* * *"}, {"input": "8\n -406 10\n 512 859\n 494 362\n -955 -475\n 128 553\n -986 -885\n 763 77\n 449 310", "output": "7641.9817824387"}] |
Print the average length of the paths. Your output will be judges as correct
when the absolute difference from the judge's output is at most 10^{-6}.
* * * | s836715255 | Runtime Error | p02861 | Input is given from Standard Input in the following format:
N
x_1 y_1
:
x_N y_N | import sys
sys.setrecursionlimit(10**6)
input = sys.stdin.readline
def comb(n, k, p):
"""power_funcを用いて(nCk) mod p を求める"""
from math import factorial
if n < 0 or k < 0 or n < k:
return 0
if n == 0 or k == 0:
return 1
a = factorial(n) % p
b = factorial(k) % p
c = factorial(n - k) % p
return (a * power_func(b, p - 2, p) * power_func(c, p - 2, p)) % p
def power_func(a, b, p):
"""a^b mod p を求める"""
if b == 0:
return 1
if b % 2 == 0:
d = power_func(a, b // 2, p)
return d * d % p
if b % 2 == 1:
return (a * power_func(a, b - 1, p)) % p
X, Y = map(int, input().split())
if (X + Y) % 3 != 0:
print(0)
sys.exit()
val = [X, Y]
val_min = min(val)
val_min_sho = int(val_min / 3)
X_henkan = X - 3 * val_min_sho
Y_henkan = Y - 3 * val_min_sho
if X_henkan == 0 and Y_henkan == 0:
n = (val_min_sho) * 2
n_2 = int(n / 2)
print(comb(n, n_2, 10**9 + 7))
elif Y_henkan != 0 and (X_henkan / Y_henkan == 2):
n = (val_min_sho) * 2 + Y_henkan
n_2 = val_min_sho
print(comb(n, n_2, 10**9 + 7))
elif X_henkan != 0 and (Y_henkan / X_henkan == 2):
n = (val_min_sho) * 2 + X_henkan
n_2 = val_min_sho
print(comb(n, n_2, 10**9 + 7))
else:
print(0)
| Statement
There are N towns in a coordinate plane. Town i is located at coordinates
(x_i, y_i). The distance between Town i and Town j is \sqrt{\left(x_i-
x_j\right)^2+\left(y_i-y_j\right)^2}.
There are N! possible paths to visit all of these towns once. Let the length
of a path be the distance covered when we start at the first town in the path,
visit the second, third, \dots, towns, and arrive at the last town (assume
that we travel in a straight line from a town to another). Compute the average
length of these N! paths. | [{"input": "3\n 0 0\n 1 0\n 0 1", "output": "2.2761423749\n \n\nThere are six paths to visit the towns: 1 \u2192 2 \u2192 3, 1 \u2192 3 \u2192 2, 2 \u2192 1 \u2192 3, 2 \u2192 3\n\u2192 1, 3 \u2192 1 \u2192 2, and 3 \u2192 2 \u2192 1.\n\nThe length of the path 1 \u2192 2 \u2192 3 is\n\\sqrt{\\left(0-1\\right)^2+\\left(0-0\\right)^2} +\n\\sqrt{\\left(1-0\\right)^2+\\left(0-1\\right)^2} = 1+\\sqrt{2}.\n\nBy calculating the lengths of the other paths in this way, we see that the\naverage length of all routes is:\n\n\\frac{\\left(1+\\sqrt{2}\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)+\\left(2\\right)+\\left(1+\\sqrt{2}\\right)}{6}\n= 2.276142...\n\n* * *"}, {"input": "2\n -879 981\n -866 890", "output": "91.9238815543\n \n\nThere are two paths to visit the towns: 1 \u2192 2 and 2 \u2192 1. These paths have the\nsame length.\n\n* * *"}, {"input": "8\n -406 10\n 512 859\n 494 362\n -955 -475\n 128 553\n -986 -885\n 763 77\n 449 310", "output": "7641.9817824387"}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s941370951 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | #!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI():
return list(map(int, stdin.readline().split()))
def LF():
return list(map(float, stdin.readline().split()))
def LI_():
return list(map(lambda x: int(x) - 1, stdin.readline().split()))
def II():
return int(stdin.readline())
def IF():
return float(stdin.readline())
def LS():
return list(map(list, stdin.readline().split()))
def S():
return list(stdin.readline().rstrip())
def IR(n):
return [II() for _ in range(n)]
def LIR(n):
return [LI() for _ in range(n)]
def FR(n):
return [IF() for _ in range(n)]
def LFR(n):
return [LI() for _ in range(n)]
def LIR_(n):
return [LI_() for _ in range(n)]
def SR(n):
return [S() for _ in range(n)]
def LSR(n):
return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")
# A
def A():
a, b = LI()
print((a + b) % 24)
return
# B
def B():
return
# C
def C():
return
# D
def D():
return
# E
def E():
return
# F
def F():
return
# G
def G():
return
# H
def H():
return
# Solve
if __name__ == "__main__":
A()
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s836978939 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | # -*- coding: utf-8 -*-
#############
# Libraries #
#############
import sys
input = sys.stdin.readline
import math
from collections import deque
from fractions import gcd
from functools import lru_cache
#############
# Constants #
#############
MOD = 10**9 + 7
INF = float("inf")
#############
# Functions #
#############
######INPUT######
def inputI():
return int(input().strip())
def inputS():
return input().strip()
def inputIL():
return list(map(int, input().split()))
def inputSL():
return list(map(str, input().split()))
def inputILs(n):
return list(int(input()) for _ in range(n))
def inputSLs(n):
return list(input().strip() for _ in range(n))
def inputILL(n):
return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n):
return [list(map(str, input().split())) for _ in range(n)]
#####Inverse#####
def inv(n):
return pow(n, MOD - 2, MOD)
######Combination######
kaijo_memo = []
def kaijo(n):
if len(kaijo_memo) > n:
return kaijo_memo[n]
if len(kaijo_memo) == 0:
kaijo_memo.append(1)
while len(kaijo_memo) <= n:
kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
return kaijo_memo[n]
gyaku_kaijo_memo = []
def gyaku_kaijo(n):
if len(gyaku_kaijo_memo) > n:
return gyaku_kaijo_memo[n]
if len(gyaku_kaijo_memo) == 0:
gyaku_kaijo_memo.append(1)
while len(gyaku_kaijo_memo) <= n:
gyaku_kaijo_memo.append(
gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD
)
return gyaku_kaijo_memo[n]
def nCr(n, r):
if n == r:
return 1
if n < r or r < 0:
return 0
ret = 1
ret = ret * kaijo(n) % MOD
ret = ret * gyaku_kaijo(r) % MOD
ret = ret * gyaku_kaijo(n - r) % MOD
return ret
######Factorization######
def factorization(n):
arr = []
temp = n
for i in range(2, int(-(-(n**0.5) // 1)) + 1):
if temp % i == 0:
cnt = 0
while temp % i == 0:
cnt += 1
temp //= i
arr.append([i, cnt])
if temp != 1:
arr.append([temp, 1])
if arr == []:
arr.append([n, 1])
return arr
#####LCM#####
def lcm(a, b):
return a * b // gcd(a, b)
#############
# Main Code #
#############
A, B = inputIL()
print((A + B) % 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s399797442 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | num = int(input())
def function(a, b):
return max(len(str(a)), len(str(b)))
d = len(str(num))
for i in range(1, num + 1):
if num % i == 0:
b = int(num // i)
c = function(i, b)
if d >= c:
d = c
else:
print(d)
exit()
print(d)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s328315699 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | from sys import stdin
import operator as op
import numpy
import math
def combination_table(N):
C = []
for i in range(N + 1):
C.append([0] * (N + 1))
for i in range(N + 1):
for j in range(i + 1):
if j == 0 or j == i:
C[i][j] = 1
else:
C[i][j] = C[i - 1][j - 1] + C[i - 1][j]
return C
if __name__ == "__main__":
N, A, B = stdin.readline().split(" ")
N = int(N)
A = int(A)
B = int(B)
V = []
line = stdin.readline().split(" ")
unique_elements = dict()
for e in line:
V.append(int(e))
if not int(e) in unique_elements:
unique_elements[int(e)] = 1
else:
unique_elements[int(e)] += 1
V.sort(reverse=True)
C = combination_table(N)
# find optimal selections between A and B
optimal = [A]
highest_avg = -1
for i in range(A, B + 1):
avg = float(sum(V[:i])) / float(i)
if avg > highest_avg:
highest_avg = avg
optimal = [i] # reset the list
elif avg == highest_avg:
if not i in optimal:
optimal.append(i)
total = 1
for e in optimal:
# unique elements and count in for optimal value
op_elemements = dict()
for i in range(e):
if V[i] in op_elemements:
op_elemements[V[i]] += 1
else:
op_elemements[V[i]] = 1
# find the sum
for key, value in op_elemements.items():
# print (unique_elements[key], value, C[unique_elements[key]][value])
total = total * C[unique_elements[key]][value]
print("{:6f}".format(highest_avg))
print(int(total))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s284285174 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | print((eval(input().replace(" ", "+")) % 24))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s942561485 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | print(eval(input().replace(*" +")) % 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s069495412 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | print(eval(input().replace(" ", "+")))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s189811694 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | f = lambda x: (x[0] + x[1]) % 24
print(f(list(map(int, input().split()))))
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s284423240 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | p = eval(input().replace(" ", "+"))
print(p - 24 if p > 23 else p)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s778985798 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | n = sum(list(map(int, input().split())))
print(n - 24 if n > 24 else n)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s281667392 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a,b=map(int,input().split())
print(max(a+b,a+b-24) | Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s286556683 | Wrong Answer | p03773 | The input is given from Standard Input in the following format:
A B | [a, b] = map(int, input().split())
print((a + b + 23) % 24 + 1)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s777909857 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | A, B = map(int, input().split(" "))
print(A + B - 24 if A + B >= 24 else A + B)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s450357006 | Runtime Error | p03773 | The input is given from Standard Input in the following format:
A B | a,b = map(int,input().split())
print (a+b) if a+b >= 24 print (a+b-24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Print the hour of the starting time of the contest in 24-hour time.
* * * | s368596056 | Accepted | p03773 | The input is given from Standard Input in the following format:
A B | arr = map(int, input().split())
print(sum(arr) % 24)
| Statement
Dolphin loves programming contests. Today, he will take part in a contest in
AtCoder.
In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to
as "21 o'clock".
The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time. | [{"input": "9 12", "output": "21\n \n\nIn this input, the current time is 9 o'clock, and 12 hours later it will be 21\no'clock in 24-hour time.\n\n* * *"}, {"input": "19 0", "output": "19\n \n\nThe contest has just started.\n\n* * *"}, {"input": "23 2", "output": "1\n \n\nThe contest will begin at 1 o'clock the next day."}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.