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 |
|---|---|---|---|---|---|---|---|
Print the performance required to achieve the objective.
* * * | s392384729 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | print((input() + input()) / 2)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s385058289 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R,G=map(int,input().split())
print(2*G-R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s690059991 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r = int(input())
g = int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s976283013 | Wrong Answer | p03563 | Input is given from Standard Input in the following format:
R
G | print(input() * -1 + input() * 2)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s462104603 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | a, m = map(int, input().split())
print(2 * m - a)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s216795396 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r = int(input())
g = int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s547923477 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | g=input()
r=input()
print(2r-g)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s543466813 | Wrong Answer | p03563 | Input is given from Standard Input in the following format:
R
G | print((int(input()) + int(input())) / 2)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s318007754 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | print(abs(int(input())-int(input())*2) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s508430745 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r = int(input())
g = int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s727947835 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | print(-int(input()) + int(input()*2) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s541777107 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R = int(input(())
B = int(input())
print(2 * B - R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s422771796 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | # coding:utf-8
R=int(input())
G=int(input())
print(2G-R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s969834751 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r=map(int,input())
g=map(int,input())
print(2g-r)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s568422137 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | a=input()
a=int(a)
s=input()
s=int(s)
b=2s-a
print(b) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s850373723 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R = int(input())
G = int(input())
print(2G - R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s669401286 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R = int(input())
G = int(input())
print(2G-R)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s798174061 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | G,R= map(int, input().split())
print(str(2G-R)) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s251736533 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r = int(input())
g = int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s590148351 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | A = int(input())
B = int(input())
print(B*2-A))
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s194837096 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r=int(input())
g=int(input())
print(int(g*2−r)) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s499064610 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r,g=[int(input()) for i range(2)]
print(g*2-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s801504379 | Wrong Answer | p03563 | Input is given from Standard Input in the following format:
R
G | p = input
a, b = map(int, [p(), p()])
print(abs(b - a) + b)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s873131878 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r = int(input())
g = int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s322157335 | Accepted | p03563 | Input is given from Standard Input in the following format:
R
G | ## -*- coding:utf-8
# import os
# import sys
# import re
# import deque
R = int(input().rstrip())
G = int(input().rstrip())
# G=(R+X)/2
# 2G=(R+X)
# 2G-R=X
print((2 * G) - R, flush=True)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s932491748 | Accepted | p03563 | Input is given from Standard Input in the following format:
R
G | num = int(input())
num2 = int(input())
print(num2 + (num2 - num))
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s382124237 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | import java.util.*;
import java.lang.*;
public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int r = sc.nextInt();
int g = sc.nextInt();
int result = g * 2 - r;
System.out.println(result);
sc.close();
}
} | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s518518172 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | # -*- coding:utf-8 -*-
R=int(input())
G=int(input())
print(2G-R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s634845683 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | # coding:utf-8
n = [int(i) for i in input().split()]
n1 = n[1] * 2 - n[0]
print(n1)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s855388320 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | h, w = 2, 3
c = []
for _ in range(h):
c.append(input())
if c[0][0] == c[1][2] and c[0][1] == c[1][1] and c[0][2] == c[1][0]:
print("YES")
else:
print("NO")
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s819760296 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | S = input()
T = input()
rec = []
for i in range(len(S)):
flag = True
Z = S
for j in range(len(T)):
if Z[i] == T[j]:
for e in range(i - j):
if Z[e] == "?":
Z = Z.replace("?", "a", 1)
for k in range(len(T)):
if Z[i + k - j] == T[k]:
continue
elif Z[i + k - j] == "?":
Z = Z.replace("?", T[k], 1)
print(Z)
else:
flag = False
if flag:
Z = Z.replace("?", "a")
rec.append(Z)
if rec == []:
print("UNRESTORABLE")
else:
print(rec[-1])
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s796228975 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | from itertools import accumulate as ac
n = int(input()) + 2
t = [0] + list(map(int, input().split())) + [0]
v = [0] + list(map(int, input().split())) + [0]
s = [0] + list(ac(t))
def f(i, x):
if s[i] <= x <= s[i + 1]:
return v[i]
elif x < s[i]:
return v[i] + s[i] - x
else:
return v[i] + x - s[i + 1]
c = float("INF")
for i in range(n):
c = min(c, f(i, 0))
e = 0
for i in range(1, 2 * s[-1] + 1):
i = i / 2
d = float("INF")
for j in range(n):
d = min(d, f(j, i))
e += 0.25 * (c + d)
c = d
print(e)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s216026039 | Accepted | p03563 | Input is given from Standard Input in the following format:
R
G | print(int(-int(input()) + 2 * float(input())))
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s162659011 | Accepted | p03563 | Input is given from Standard Input in the following format:
R
G | print(eval(input() + "*-1+2*" + input()))
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s721887225 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R,G=map(int,input().split())
print(2*G-R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s518894064 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R=int(input())
print((int(input())*2-R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s544694148 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R=int(input())
G=int(input())
print(2G-R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s517988862 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | def main:
print(1000) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s285501221 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | n, k = map(int, input().split())
print(k * 2 - n)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s881124439 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | print(-int(input()+2*int(input()))
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s302970171 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r=int(input())
g=int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s678368474 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | g,r=map(int,input())
print(2r-g) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s426136004 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | R = int(input())
G = int(input())
print(2G - R) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s213046519 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | r = int(input())
g = int(input())
print(2g-r) | Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s568239168 | Accepted | p03563 | Input is given from Standard Input in the following format:
R
G | p1 = input()
p2 = input()
print(int(p2) + (int(p2) - int(p1)))
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s006712547 | Accepted | p03563 | Input is given from Standard Input in the following format:
R
G | a = input()
a = int(a)
s = input()
s = int(s)
b = 0
b = 2 * s - a
print(b)
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s853701812 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | #include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = 0; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main() {
int r, g;
cin >> r >> g;
cout << 2 * g - r << endl;
return 0;
}
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the performance required to achieve the objective.
* * * | s666993973 | Runtime Error | p03563 | Input is given from Standard Input in the following format:
R
G | A = []
for i in range(2):
A[i] = int(input())
print(A[1] * 2 - A[0])
| Statement
Takahashi is a user of a site that hosts programming contests.
When a user competes in a contest, the _rating_ of the user (not necessarily
an integer) changes according to the _performance_ of the user, as follows:
* Let the current rating of the user be a.
* Suppose that the performance of the user in the contest is b.
* Then, the new rating of the user will be the avarage of a and b.
For example, if a user with rating 1 competes in a contest and gives
performance 1000, his/her new rating will be 500.5, the average of 1 and 1000.
Takahashi's current rating is R, and he wants his rating to be exactly G after
the next contest.
Find the performance required to achieve it. | [{"input": "2002\n 2017", "output": "2032\n \n\nTakahashi's current rating is 2002. \nIf his performance in the contest is 2032, his rating will be the average of\n2002 and 2032, which is equal to the desired rating, 2017.\n\n* * *"}, {"input": "4500\n 0", "output": "-4500\n \n\nAlthough the current and desired ratings are between 0 and 4500, the\nperformance of a user can be below 0."}] |
Print the number of the pairs of a subset of the rows and a subset of the
columns that satisfy the condition, modulo 998244353.
* * * | s693028183 | Runtime Error | p03133 | Input is given from Standard Input in the following format:
N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM} | #!/usr/bin/env python3
import sys, os
try:
from typing import Any, Union, List, Tuple, Dict
except ImportError:
pass
sys.setrecursionlimit(10**6)
if os.environ.get("USER") == "shun":
def debug(*args):
print(*args, file=sys.stderr)
else:
print("NO DEBUG", file=sys.stderr)
def debug(*args):
pass
def exit():
sys.exit(0)
l = int(input())
a = []
for _ in range(l):
a.append(int(input()))
init_score = 0
for i in range(l):
if a[i] == 0:
init_score += 2
elif a[i] % 2 == 0:
pass
else:
init_score += 1
left = [0]
for i in range(l):
left.append(left[i])
if a[i] == 0:
left[i + 1] -= 2
elif a[i] % 2 == 0:
left[i + 1] += a[i]
else:
left[i + 1] += a[i] - 1
left_i = 0
left_min = left[0]
for i in range(l + 1):
if left[i] < left_min:
left_i = i
left_min = left[i]
debug(left_i, left)
right = [0] * (l + 1)
for i in range(l, 0, -1):
right[i - 1] = right[i]
if a[i - 1] == 0:
right[i - 1] -= 2
elif a[i - 1] % 2 == 0:
right[i - 1] += a[i - 1]
else:
right[i - 1] += a[i - 1] - 1
right_i = 0
right_min = right[0]
for i in range(l + 1):
if right[i] < right_min:
right_i = i
right_min = right[i]
debug(right_i, right)
# odd
temp_score = init_score + left_min + right_min
b = a[left_i:right_i]
k = len(b)
for i in range(k):
if b[i] == 0:
temp_score -= 1
elif b[i] % 2 == 0:
temp_score += 1
else:
temp_score -= 1
left = [0]
for i in range(k):
left.append(left[i])
if b[i] == 0:
left[i + 1] += 1
elif b[i] % 2 == 0:
left[i + 1] -= 1
else:
left[i + 1] += 1
left_i = 0
left_min = left[0]
for i in range(k + 1):
if left[i] < left_min:
left_i = i
left_min = left[i]
debug(left_i, left)
right = [0] * (k + 1)
for i in range(k, 0, -1):
right[i - 1] = right[i]
if b[i - 1] == 0:
right[i - 1] += 1
elif b[i - 1] % 2 == 0:
right[i - 1] -= 1
else:
right[i - 1] += 1
right_i = 0
right_min = right[0]
for i in range(k + 1):
if right[i] < right_min:
right_i = i
right_min = right[i]
debug(right_i, right)
score = temp_score + left_min + right_min
print(score)
| Statement
There is a square grid with N rows and M columns. Each square contains an
integer: 0 or 1. The square at the i-th row from the top and the j-th column
from the left contains a_{ij}.
Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of
the columns, find the number of the pairs that satisfy the following
condition, modulo 998244353:
* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd. | [{"input": "2 2\n 0 1\n 1 0", "output": "6\n \n\nFor example, if A consists of the first row and B consists of both columns,\nthe sum of the numbers contained in the intersection is 0+1=1.\n\n* * *"}, {"input": "2 3\n 0 0 0\n 0 1 0", "output": "8"}] |
Print the number of the pairs of a subset of the rows and a subset of the
columns that satisfy the condition, modulo 998244353.
* * * | s732209428 | Runtime Error | p03133 | Input is given from Standard Input in the following format:
N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM} | import numpy as np
IN() = lambda: list(map(int, input().split()))
n, m = IN()
a = np.array([IN() for i in range(n)])
r = np.linalg.matrix_rank(a)
print((2 ** (n + m - 1) - 2 ** (n + m - 1 - r)) % 998244353)
| Statement
There is a square grid with N rows and M columns. Each square contains an
integer: 0 or 1. The square at the i-th row from the top and the j-th column
from the left contains a_{ij}.
Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of
the columns, find the number of the pairs that satisfy the following
condition, modulo 998244353:
* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd. | [{"input": "2 2\n 0 1\n 1 0", "output": "6\n \n\nFor example, if A consists of the first row and B consists of both columns,\nthe sum of the numbers contained in the intersection is 0+1=1.\n\n* * *"}, {"input": "2 3\n 0 0 0\n 0 1 0", "output": "8"}] |
Print the number of the pairs of a subset of the rows and a subset of the
columns that satisfy the condition, modulo 998244353.
* * * | s706786959 | Wrong Answer | p03133 | Input is given from Standard Input in the following format:
N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM} | import numpy as np
import itertools
from scipy import signal
N, M = [int(s) for s in input().split()]
A = np.zeros([N, M])
for n in range(N):
A[n] = [int(m) for m in input().split()]
N_fft, M_fft = 2 * N, 2 * M
Fa = np.fft.rfft2(A, [N_fft, M_fft])
oddnum = 0
for n, m in itertools.product(range(N), range(M)):
W = np.fft.rfft2(np.ones([n + 1, m + 1]), [N_fft, M_fft])
Aw = np.fft.irfft2(Fa * W).astype(int)
print(Aw[n:N, m:M])
oddnum += np.sum(Aw[n:N, m:M] % 2 == 1)
print(oddnum % 998244353)
| Statement
There is a square grid with N rows and M columns. Each square contains an
integer: 0 or 1. The square at the i-th row from the top and the j-th column
from the left contains a_{ij}.
Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of
the columns, find the number of the pairs that satisfy the following
condition, modulo 998244353:
* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd. | [{"input": "2 2\n 0 1\n 1 0", "output": "6\n \n\nFor example, if A consists of the first row and B consists of both columns,\nthe sum of the numbers contained in the intersection is 0+1=1.\n\n* * *"}, {"input": "2 3\n 0 0 0\n 0 1 0", "output": "8"}] |
Print the number of the pairs of a subset of the rows and a subset of the
columns that satisfy the condition, modulo 998244353.
* * * | s002699212 | Wrong Answer | p03133 | Input is given from Standard Input in the following format:
N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM} | import numpy as np
n, m = map(int, input().split())
f = n * m > 998244353
lis = []
for i in range(n):
lis.append(list(map(int, input().split())))
arr = np.array(lis)
cache_dict = {}
def search(base, x1, x2, y1, y2):
use_arr = arr[x1 : x2 + 1, y1 : y2 + 1]
return (base + use_arr.sum()) % 2
def rec_search(base, x1, x2, y1, y2):
cache_dict[(x1, x2, y1, y2)] = base
if x1 - 1 >= 0:
arg1 = (x1 - 1, x2, y1, y2)
if not arg1 in cache_dict:
next_base = search(base, x1 - 1, x1 - 1, y1, y2)
cache_dict[arg1] = next_base
rec_search(next_base, x1 - 1, x2, y1, y2)
if x2 + 1 <= m - 1:
arg2 = (x1, x2 + 1, y1, y2)
if not arg2 in cache_dict:
next_base = search(base, x2 + 1, x2 + 1, y1, y2)
cache_dict[arg2] = next_base
rec_search(next_base, x1, x2 + 1, y1, y2)
if y1 - 1 >= 0:
arg3 = (x1, x2, y1 - 1, y2)
if not arg3 in cache_dict:
next_base = search(base, x1, x2, y1 - 1, y1 - 1)
cache_dict[arg3] = next_base
rec_search(next_base, x1, x2, y1 - 1, y2)
if y2 + 1 <= n - 1:
arg4 = (x1, x2, y1, y2 + 1)
if not arg4 in cache_dict:
next_base = search(base, x1, x2, y2 + 1, y2 + 1)
cache_dict[arg4] = next_base
rec_search(next_base, x1, x2, y1, y2 + 1)
point_1 = np.where(arr == 1)
for ind in zip(point_1[0], point_1[1]):
cache_dict[(ind[1], ind[1], ind[0], ind[0])] = 1
rec_search(1, ind[1], ind[1], ind[0], ind[0])
print(sum(cache_dict.values()) % 998244353)
| Statement
There is a square grid with N rows and M columns. Each square contains an
integer: 0 or 1. The square at the i-th row from the top and the j-th column
from the left contains a_{ij}.
Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of
the columns, find the number of the pairs that satisfy the following
condition, modulo 998244353:
* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd. | [{"input": "2 2\n 0 1\n 1 0", "output": "6\n \n\nFor example, if A consists of the first row and B consists of both columns,\nthe sum of the numbers contained in the intersection is 0+1=1.\n\n* * *"}, {"input": "2 3\n 0 0 0\n 0 1 0", "output": "8"}] |
Print the number of the pairs of a subset of the rows and a subset of the
columns that satisfy the condition, modulo 998244353.
* * * | s568186056 | Wrong Answer | p03133 | Input is given from Standard Input in the following format:
N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM} | # 800 points
import math
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
n, m = map(int, input().split())
matrix = []
for k in range(n):
str_row = input().split()
row = []
for j in range(m):
row.append(int(str_row[j]) % 2)
matrix.append(row)
res_sum = 0
for mmin in range(m):
for mmax in range(mmin, m):
for nmin in range(n):
for nmax in range(nmin, n):
print(mmin, mmax, nmin, nmax)
counter = 0
for mi in range(mmin, mmax + 1):
for ni in range(nmin, nmax + 1):
counter += matrix[ni][mi]
print(mi, ni)
print("couner", counter)
if counter % 2 == 1:
res_sum = (res_sum + 1) % 998244353
print(res_sum)
| Statement
There is a square grid with N rows and M columns. Each square contains an
integer: 0 or 1. The square at the i-th row from the top and the j-th column
from the left contains a_{ij}.
Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of
the columns, find the number of the pairs that satisfy the following
condition, modulo 998244353:
* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd. | [{"input": "2 2\n 0 1\n 1 0", "output": "6\n \n\nFor example, if A consists of the first row and B consists of both columns,\nthe sum of the numbers contained in the intersection is 0+1=1.\n\n* * *"}, {"input": "2 3\n 0 0 0\n 0 1 0", "output": "8"}] |
Print the number of the pairs of a subset of the rows and a subset of the
columns that satisfy the condition, modulo 998244353.
* * * | s456278197 | Wrong Answer | p03133 | Input is given from Standard Input in the following format:
N M
a_{11} ... a_{1M}
:
a_{N1} ... a_{NM} | n, m = map(int, input().split())
matrix = [list(map(int, input().split())) for i in range(n)]
def change(i, j, matrix):
line = (matrix[i], matrix[j])
matrix[i] = line[1]
matrix[j] = line[0]
return matrix
def kbai(i, k, matrix):
for j in range(len(matrix[0])):
matrix[i][j] *= k
return matrix
def plus(i, j, k, matrix):
for _ in range(len(matrix[0])):
matrix[i][_] += matrix[j][_] * k
return matrix
def rank(n, m, matrix):
now = 0
for j in range(m):
exist = set()
jiku = -1
for i in range(n):
if matrix[i][j] != 0:
if jiku == -1 and i >= now:
jiku = i
else:
exist |= {
i,
}
if jiku == -1:
continue
for x in range(len(exist)):
y = exist.pop()
matrix = plus(y, jiku, -1, matrix)
matrix = change(jiku, now, matrix)
now += 1
return now
r = rank(n, m, matrix)
x, y = 0, 0
num = 1
for i in range(1, n + m):
num = num * 2 % 998244353
if i == n + m - r - 1:
y = num
if i == n + m - 1:
x = num
print((x - y) % 998244353)
# https://img.atcoder.jp/yahoo-procon2019-qual/editorial.pdf
| Statement
There is a square grid with N rows and M columns. Each square contains an
integer: 0 or 1. The square at the i-th row from the top and the j-th column
from the left contains a_{ij}.
Among the 2^{N+M} possible pairs of a subset A of the rows and a subset B of
the columns, find the number of the pairs that satisfy the following
condition, modulo 998244353:
* The sum of the |A||B| numbers contained in the intersection of the rows belonging to A and the columns belonging to B, is odd. | [{"input": "2 2\n 0 1\n 1 0", "output": "6\n \n\nFor example, if A consists of the first row and B consists of both columns,\nthe sum of the numbers contained in the intersection is 0+1=1.\n\n* * *"}, {"input": "2 3\n 0 0 0\n 0 1 0", "output": "8"}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s740566190 | Wrong Answer | p04033 | The input is given from Standard Input in the following format:
a b | import os
os.read(0, 10**8).split()
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s671547226 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = map(int, input().split())
L = []
for i in range (a,b+1):
L.append(i)
P = 1
for j in L:
P *= j
if P > 0:
print('Positive')
elif P = 0:
print('Zero')
else:
print('Negetive') | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s475684347 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | import math
var numero1 = -10 * 9, numero2 = 10 * - 9, cadena "1, 3,";
console.log( numero1 === numero2);
console.log( numero1 !== numero2;
console.log( numero1 < numero2);
console.log( numero1 > numero2);
console.log( numero1 <= numero2);
console.log( -90 >= 90);
document.write(numero1 === 1,3)
document.write(numero2 === "positive, 1*2*3 = 6")
return = 0 | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s665716431 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b=map(int,input().split())
if a>0 and b>0:
print('Positive')
exit()
elif a=0 or b=0:
print('Zero')
exit()
elif a<0 and 0<b:
if abs(a)%2==0:
print('Positive')
exit()
else:
print('Negative')
exit()
else:
if abs(b-a)%2==0:
print('Negative')
exit()
else:
print('Positive')
exit()
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s423735064 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | redBalls = []
currentRedBall = 0
def putBall(i, balles, routes):
global redBalles
global currentRedBall
if i == len(routes):
redBalles[currentRedBall] = 1
return None
_from = routes[i][0] - 1
_to = routes[i][1] - 1
if balles[_from] % 2 == 0:
balles[_from] -= 2
balles[_to] += 2
putBall(i + 1, balles, routes)
else:
if balles[_from] == 1:
balles[_from] -= 1
balles[_to] += 1
currentRedBall = _to
putBall(i + 1, balles, routes)
else:
_balles = [b for b in balles]
_balles[_from] -= 1
_balles[_to] += 1
currentRedBall = _to
putBall(i + 1, _balles, routes)
_balles = [b for b in balles]
_balles[_from] -= 2
_balles[_to] += 2
currentRedBall = _from
putBall(i + 1, _balles, routes)
def answer(n, routes):
global redBalles
redBalles = [0] * n
balles = [1] + [2] * (n - 1)
putBall(0, balles, routes)
return sum(redBalles)
n, m = map(int, input().split())
routes = []
for _ in range(m):
routes.append(list(map(int, input().split())))
print(answer(n, routes))
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s989601197 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int, input().split())
c = b - a
if a <= 0 <= b:
print("Zero")
elif a > 0:
print("Positive")
elif b < 0:a
if c%2 == 1:
print("Positive")
else:
print("Negative") | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s550919653 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | # C - Exception Handling
N = int(input())
A = [int(input()) for i in range(N)]
m1 = max(A)
i = 0
while A[i] < m1:
i += 1
m2 = max(A[:i] + A[i + 1 :])
for j in range(N):
print(m1 if i != j else m2)
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s334678653 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# 「番号 n以下 の辺だけを貼ったときの連結成分の大きさが z 以上」を満たす最小のn
# 並列二分探索
N, M = map(int, readline().split())
def find_root(root, x):
y = root[x]
if x == y:
return
find_root(root, y)
root[x] = root[y]
def merge(root, size, x, y):
find_root(root, x)
find_root(root, y)
rx = root[x]
ry = root[y]
if rx == ry:
return 0, 0
return (ry, rx) if size[rx] < size[ry] else (rx, ry)
def test(root, size, x, y, z):
find_root(root, x)
find_root(root, y)
rx = root[x]
ry = root[y]
if rx == ry:
return size[rx] >= z
else:
return size[rx] + size[ry] >= z
root = list(range(N + 1))
size = [1] * (N + 1)
merge_1 = [0] * (M + 1)
merge_2 = [0] * (M + 1)
for t in range(1, M + 1):
a, b = map(int, readline().split())
x, y = merge(root, size, a, b)
if x == 0:
continue
merge_1[t] = x
merge_2[t] = y
root[y] = x
size[x] += size[y]
Q = int(readline())
X = []
Y = []
Z = []
for line in readlines():
x, y, z = map(int, line.split())
X.append(x)
Y.append(y)
Z.append(z)
left = [0] * Q # 連結成分は z 未満
right = [M] * Q # 連結成分は z 以上
q = tuple([] for _ in range(M + 1)) # 調べる時刻、番号
done = [False] * (M + 1)
for i in range(Q):
q[M // 2].append(i)
rest = Q
while rest:
root = list(range(N + 1))
size = [1] * (N + 1)
for t in range(1, M + 1):
x = merge_1[t]
y = merge_2[t]
if x != 0:
root[y] = x
size[x] += size[y]
if done[t] or not q[t]:
continue
done[t] = True
L = left[q[t][0]]
R = right[q[t][0]]
ML = (t + L) // 2
MR = (t + R) // 2
for i in q[t]:
x = X[i]
y = Y[i]
z = Z[i]
if test(root, size, x, y, z):
right[i] = t
mid = ML
else:
left[i] = t
mid = MR
if left[i] < mid:
q[mid].append(i)
else:
rest -= 1
for x in right:
print(x)
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s240656002 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = map(int,input().split())
if (a>0) & (b>0):
print('Positive')
elif (a<0) & (b>0):
print('Zero')
elif (a==0) or(b==0):
print('Zero')
else:
if (b-a)%2==1:
print('Positive')
else:
print('Negative') | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s507032020 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = map(int,inout().split())
if(a*b<=0)print(Zero)
elif(a<0 and b-a%2==0)
print(Positive)
else
print(Negative) | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s300454518 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = map(int,input().split())
if(a*b<=0)print(Zero)
elif(a<0 and (b-a)%2==0)
print(Positive)
else
print(Negative) | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s162799977 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = map(int,input().split())
if(a*b<=0)
print(Zero)
elif(a<0 and (b-a)%2==0)
print(Positive)
else
print(Negative) | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s189097887 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time
sys.setrecursionlimit(10**7)
inf = 10**10
mod = 10**9 + 7
def f():
a,b = list(map(int, input().split()))
if a * b == 0 or (a < 0 && b > 0):
return 'Zero'
if b < 0 and (a+b) % 2 == 0
return 'Negative'
return 'Positive'
print(f())
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s407844971 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = [int(i) for i in input().split() ]
multi_sum = reduce(lambda x,y:x*y,[ for i in range(a,b) ])
if multi_sum > 0:
print("Positive")
elif multi_sum < 0:
print("Negative")
else:
print("Zero") | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s011343039 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | # For taking integer inputs.
def inp():
return(int(input()))
# For taking List inputs.
def inlist():
return(list(map(int, input().split())))
# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Python, Strings are Immutable.
def instr():
s = input()
return(list(s[:len(s)]))
# For taking space seperated integer variable inputs.
def invr():
return(map(int, input().split()))
a, b = invr()
res = "Negative"
if a > 0 and b > 0:
res = "Positive"
if a < 0 and b < 0:
temp = abs(abs(a)-abs(b)) + 1
if temp % 2 == 0:
res = "positive"
else:
res = "Negative"
if a == b:
res = "Positive"
if a <= 0 and b = > 0:
res = "Zero"
print(res)
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s297094039 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b=map(int,input().split())
if a*b=0:print("Zero")
elif 0<a:print("Positive")
else:
if -a%2==0:print("Positive")
else:print("Negative") | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s119041803 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int, input().split())
if a > 0:
print('Positive')
else if b >= 0:
print('Zero')
else if (b-a) % 2 == 1:
print('Positive')
else:
print('Negative') | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s338204126 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b=map(int,input().split())
if a<=b<0:
if
print('Negative' if (-1)**(a-b-1)==-1 else 'Positive')
elif a<=0<=b:
print('Zero')
else:
print('Positive') | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s599558952 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b=map(int, input().split())
if b < 0:
if (b-a+1) % 2 == 0:
ans = 'Positive'
elif (b-a+1) % 2 == 1:
ans = 'Negative'
elif a > 0:
ans='Positive'
else
ans='Zeros'
print(ans) | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s028747470 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int, input().split())
nega_cnt = 0
is_zero = False
for x in range(a, b+1):
if x < 0:
nega_cnt += 1
elif x == 0:
print("Zero")
is_zero = True
if not is_zero:
if nega_cnt % 2 == 1:
print("Negative")
else:
print("Positive")
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s570309303 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int, input().split())
if a <= 0 and b >= 0:
print("Zero")
elif a > 0 and b > 0:
print("Positive")
elif a < 0 and b > 0 and abs(0-a) % 2 == 0:
print("Positive")
elif a < 0 and b < 0 and abs(0-a) % 2 == 0::
print("Positive")
else:
print("Negative") | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s807455549 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | import sys
# import numpy as np
def main():
a, b = map(int, sys.stdin.read().split())
if 0 < a:
ans = 'Positive'
elif 0 <= b:
ans = 'Zero'
else:
if (b - a + 1) % 2 == 0:
ans = 'Positive'
else:
ans = 'Negative'
print(ans)
if __name__ == '__main__':
main( | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s283770597 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vvll> vvvll;
typedef vector<string> vstr;
typedef pair<ll, ll> pll;
typedef vector<pll> vp;
typedef map<ll, ll> mll;
typedef map<string, ll> mstrll;
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define maxs(x, y) (x = max(x, y))
#define mins(x, y) (x = min(x, y))
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(ll i = ll(a); i < ll(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
#define out(x) cout << (x)
#define indent() cout << '\n'
#define print(x) cout << (x) << '\n'
#define debug(x) cerr << #x << ": " << (x) << '\n'
ll gcd(ll a, ll b){return b != 0 ? gcd(b, a % b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}
ll factorial(ll a){return a < 2 ? 1 : factorial(a - 1) * a;}
ll summation(ll a){return a < 1 ? 0 : (a * a + a) / 2;}
const ll INF = 1e16;
const ll MOD = 1e9 + 7;
const string ALPHABETS = "abcdefghijklmnopqrstuvwxyz";
ll dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
//ll dx[] = {-1, 0, 1, -1, 1, -1, 0, 1}, dy[] = {-1, -1, -1, 0, 0, 1, 1, 1};
ll n, m, x, y, z, w, h;
string s, t;
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
while(cin >> n >> m){
ll ans = 0, tmp = 0, cnt = 0, mx = -INF, mn = INF;
ll a[] = {}, b[] = {}, c[] = {};
vll v;
if(n * m <= 0){
print("Zero");
}else{
if(n < 0){
print(abs(n - m) % 2 ? "Positive" : "Negative");
}else{
print("Positive");
}
}
}
}
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s017517286 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = list(map(int,input().split()))
if( a > b ):
a,b = b,a
if a > 0 and b > 0:
print("Positive")
elif a <= 0 and b >= 0:
print("Zero")
else:
if (abs(a) - abs(b)) % 2 == 0:
print("Negative")
else:
print("Pisitive")-1 1 | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s718574067 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = input().split()
a, b = int(a), int(b)
n = 1
for i in range(a, b + 1):
n *= i
if a < 0 < b:
print("Zero")
else 0 < a < b:
print("Positive")
if a < b < 0:
if (b - a + 1) % 2 == 0:
print("Positive")
else:
print("Negative")
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s535695052 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int,input().split())
if b < 0:
if (b-a+1) % 2 == 0:
ans = 'Positive'
elif (b-a+1) % 2 == 1:
ans = 'Negative'
elif a > 0:
ans='Positive'
else
ans='Zero'
print(ans) | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s402411214 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | def main():
t = input().split(" ")
A = int(t[0])
B = int(t[1])
if B < 0:
if (B - A) % 2 == 1
print("Positive")
else :
print("Negative")
elif 0 < A:
print("Positive")
else:
print("Zero")
main() | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s843402956 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int, input().split())
if a <= 0 and b => 0:
print("Zero")
elif a > 0 and b > 0:
print('Positive')
elif a < 0 and b < 0:
if (b - a + 1) % 2:
print('Negative')
else:
print('Positive')
| Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s508976362 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a,b = [int(i) for i in input().split()]
if a > 0:
print('Positive')
elif a = 0:
print('Zero')
else:
if b >= 0:
print('Zero')
elif b-a % 2 == 0:
print('Negative')
else:
print('Positive') | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s965887030 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a=list(map(int,input().split()))
b=1
for i in range(a[0],a[1]+1):
b*=i
if b>0:
print('Positive')
elif b<0:
print('Negative')
elif b=0:
print('Zero') | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the product is positive, print `Positive`. If it is negative, print
`Negative`. If it is zero, print `Zero`.
* * * | s463504911 | Runtime Error | p04033 | The input is given from Standard Input in the following format:
a b | a, b = map(int,input().split())
num = (b-a)+1
if min(a,b) > 0 or:
print("Positive")
elif max(a,b) < 0 and num%2!=0:
print("Positive")
elif max(a,b) < 0 and num%2==0:
print("Negative")
else:
print("Zero") | Statement
You are given two integers a and b (a≤b). Determine if the product of the
integers a, a+1, …, b is positive, negative or zero. | [{"input": "1 3", "output": "Positive\n \n\n1\u00d72\u00d73=6 is positive.\n\n* * *"}, {"input": "-3 -1", "output": "Negative\n \n\n(-3)\u00d7(-2)\u00d7(-1)=-6 is negative.\n\n* * *"}, {"input": "-1 1", "output": "Zero\n \n\n(-1)\u00d70\u00d71=0."}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s441391419 | Accepted | p03719 | Input is given from Standard Input in the following format:
A B C | import math
import queue
import bisect
import heapq
import time
import itertools
mod = int(1e9 + 7)
def swap(a, b):
return (b, a)
def gcd(a, b): # 最大公約数
if a < b:
a, b = swap(a, b)
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b): # 最小公倍数
return a / gcd(a, b) * b
def divisors(a): # 約数列挙
divisors = []
for i in range(1, int(a**0.5) + 1):
if a % i == 0:
divisors.append(i)
if i != a // i:
divisors.append(a // i)
return divisors
def is_prime(a): # 素数判定
if a < 2:
return False
elif a == 2:
return True
elif a % 2 == 0:
return False
sqrt_num = int(a**0.5)
for i in range(3, sqrt_num + 1, 2):
if a % i == 0:
return False
return True
def prime_num(a): # 素数列挙
pn = [2]
for i in range(3, int(a**0.5), 2):
prime = True
for j in pn:
if i % j == 0:
prime = False
break
if prime:
pn.append(i)
return pn
def prime_fact(a): # 素因数分解
sqrt = math.sqrt(a)
res = []
i = 2
if is_prime(a):
res.append(a)
else:
while a != 1:
while a % i == 0:
res.append(i)
a //= i
i += 1
return res
def main():
a, b, c = map(int, input().split())
if a <= c and b >= c:
print("Yes")
else:
print("No")
return
if __name__ == "__main__":
main()
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s575344594 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | from copy import deepcopy
from sys import exit, setrecursionlimit
import math
from collections import defaultdict, Counter, deque
from fractions import Fraction as frac
setrecursionlimit(1000000)
def main():
a, b, c = map(int, input().split())
if a < c < d:
print("Yes")
else:
print("No")
def zip(a):
mae = a[0]
ziparray = [mae]
for i in range(1, len(a)):
if mae != a[i]:
ziparray.append(a[i])
mae = a[i]
return ziparray
def is_prime(n):
if n < 2:
return False
for k in range(2, int(math.sqrt(n)) + 1):
if n % k == 0:
return False
return True
def list_replace(n, f, t):
return [t if i == f else i for i in n]
def base_10_to_n(X, n):
X_dumy = X
out = ""
while X_dumy > 0:
out = str(X_dumy % n) + out
X_dumy = int(X_dumy / n)
if out == "":
return "0"
return out
def gcd(l):
x = l.pop()
y = l.pop()
while x % y != 0:
z = x % y
x = y
y = z
l.append(min(x, y))
return gcd(l) if len(l) > 1 else l[0]
class Queue:
def __init__(self):
self.q = deque([])
def push(self, i):
self.q.append(i)
def pop(self):
return self.q.popleft()
def size(self):
return len(self.q)
def debug(self):
return self.q
class Stack:
def __init__(self):
self.q = []
def push(self, i):
self.q.append(i)
def pop(self):
return self.q.pop()
def size(self):
return len(self.q)
def debug(self):
return self.q
class graph:
def __init__(self):
self.graph = defaultdict(list)
def addnode(self, l):
f, t = l[0], l[1]
self.graph[f].append(t)
self.graph[t].append(f)
def rmnode(self, l):
f, t = l[0], l[1]
self.graph[f].remove(t)
self.graph[t].remove(f)
def linked(self, f):
return self.graph[f]
class dgraph:
def __init__(self):
self.graph = defaultdict(set)
def addnode(self, l):
f, t = l[0], l[1]
self.graph[f].append(t)
def rmnode(self, l):
f, t = l[0], l[1]
self.graph[f].remove(t)
def linked(self, f):
return self.graph[f]
main()
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s325437781 | Wrong Answer | p03719 | Input is given from Standard Input in the following format:
A B C | def func(a, b, c):
if a <= c <= b:
return "Yes"
else:
return "No"
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s534166010 | Wrong Answer | p03719 | Input is given from Standard Input in the following format:
A B C | N, _, *L = map(int, open(0).read().split())
for n in range(N):
print(L.count(n + 1))
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s056325344 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | a,b,c=map(int,input().split());print('
NYoe s'[a<=c<=b::2]) | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s610674130 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | a,b,c = map(int,input().split())
print("Yes",if a<=c<=b else "No") | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s186930768 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | if ("C">="A"),("C"<="B"):
print("Yes")
else:
print("No") | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s078917659 | Wrong Answer | p03719 | Input is given from Standard Input in the following format:
A B C | def check(A, B, C):
if A < C and C < B:
return Yes
return No
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s410883309 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | N, M = list(map(int, input().split()))
a = []
b = []
c = []
for i in range(M):
a_i, b_i, c_i = list(map(int, input().split()))
a.append(a_i)
b.append(b_i)
c.append(c_i)
cost = [-float("inf") for i in range(N)]
cost[0] = 0
flag = True
while flag:
for k in range(M):
cost[b[k] - 1] = max(cost[b[k] - 1], cost[a[k] - 1] + c[k])
if k == M - 2:
flag = False
def check():
for k in range(M):
if cost[b[k] - 1] < cost[a[k] - 1] + c[k]:
return "inf"
return cost[N - 1]
print(check())
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s068122202 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | #https://atcoder.jp/contests/abc061/tasks/abc061_d
# coding: utf-8
# Your code here!
#input_template
inpPh = 2
debug = True
#debug = False
if not debug:
inpPh = 0
input1 ='''
3 3
1 2 4
2 3 3
1 3 5
'''[1:]
input2 ='''
2 2
1 2 1
2 1 1
'''[1:]
input3 ='''
6 5
1 2 -1000000000
2 3 -1000000000
3 4 -1000000000
4 5 -1000000000
5 6 -1000000000
'''[1:]
inputXs = [input1, input2, input3, None]
if debug:
try:
inputXs.append(inputA0)
except:
pass
else:
pass
inploc = inpPh - 1 #0,1,2
if inpPh > 0:
print('selected_input:\n'+inputXs[inploc])
inpX_lst = []
if debug and inpPh > 0:
inpX_lst = inputXs[inploc].splitlines()
if inpPh == 0:
N,M = map(int, sys.stdin.readline().split())
else:
N,M = map(int, sys.stdin.readline().split())
elist = []
for i in range(M):
if inpPh == 0:
ai,bi,ci = map(int, sys.stdin.readline().split())
else:
ai,bi,ci = map(int, sys.stdin.readline().split())
ai_loc, bi_loc = ai-1, bi - 1
elist.append(( ai_loc, bi_loc,ci))
vlist =[ [None,[]] for _ in range(N)]
for e in elist:
a,b,c = e
vlist[a][1].append((a,b,-c))
s_loc,g_loc = 0, N-1
vlist[s_loc][0] = 0
#print(vlist)
for v1 in vlist:
v1_d,v1_elist = v1[0],v1[1]
#print(v1_d,v1_elist)
for e in v1_elist:
a,b,c = e
v2 = vlist[b]
v2_d, v2_elist = v2
if v1_d == None:
continue
elif v2_d == None or v2_d > v1_d +c:
vlist[b][0] = v1_d + c
g0 = vlist[g_loc][0]
for v1 in vlist:
v1_d,v1_elist = v1[0],v1[1]
#print(v1_d,v1_elist)
for e in v1_elist:
a,b,c = e
v2 = vlist[b]
v2_d, v2_elist = v2
if v1_d == None:
continue
elif v3_d == None or v2_d > v1_d +c:
vlist[b][0] = v1_d + c
g1 = vlist[g_loc][0]
if g0 != g1:
print('inf')
else:
print(-g0)
#print('res',g0,g1)
for v in vlist:
#print(v)
pass | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s715588541 | Accepted | p03719 | Input is given from Standard Input in the following format:
A B C | n = [int(_) for _ in input().split()]
if all(-100 <= i <= 100 for i in n):
print("Yes" if n[0] <= n[2] <= n[1] else "No")
else:
print("hoge!")
| Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s532795521 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | a, b, c = map(int, input().split())
if (a =< c) and (c =< b):
print('Yes')
else:
print('No') | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s551026054 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | import numpy as np
n, m = map(int,input().split())
c = np.zeros(n)
for i in range(m)
a, b = map(int,input().split())
c[a-1] + 1
c[b-1] + 1
for i in c:
print(i) | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s606104415 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | b, c, d = map(int, input().split())
if b < c :
if b <= d <= c :
print('Yes')
else :
print('No')
else :
if b <= d <= c :
print('Yes')
else :
print('No') | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
If the condition is satisfied, print `Yes`; otherwise, print `No`.
* * * | s210958305 | Runtime Error | p03719 | Input is given from Standard Input in the following format:
A B C | ss=input()
abc=ss.split()
abc[0]
if abc[2]>=abc[0] and abc[2]<=abc[1]:
print("yes")
else:
print("no) | Statement
You are given three integers A, B and C. Determine whether C is not less than
A and not greater than B. | [{"input": "1 3 2", "output": "Yes\n \n\nC=2 is not less than A=1 and not greater than B=3, and thus the output should\nbe `Yes`.\n\n* * *"}, {"input": "6 5 4", "output": "No\n \n\nC=4 is less than A=6, and thus the output should be `No`.\n\n* * *"}, {"input": "2 2 2", "output": "Yes"}] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.