-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e867dcd
commit 06bf083
Showing
6 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
n = int(input()) | ||
|
||
for _ in range(n): | ||
ax, ay, bx, by, cx, cy, dx, dy, rx, ry = map(int, input().split()) | ||
if ( | ||
rx >= ax | ||
and ry >= ay | ||
and rx <= bx | ||
and ry >= by | ||
and rx <= cx | ||
and ry <= cy | ||
and rx >= dx | ||
and ry <= dy | ||
): | ||
print(1) | ||
else: | ||
print(0) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
5 | ||
3 6 6 6 6 5 3 5 5 4 | ||
1 1 7 1 7 7 1 7 4 2 | ||
1 4 7 4 7 6 1 6 5 5 | ||
6 2 9 2 9 6 6 6 1 7 | ||
4 3 9 3 9 5 4 5 10 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
0 | ||
1 | ||
1 | ||
0 | ||
0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
https://judge.beecrowd.com/en/problems/view/1618 | ||
|
||
# Colision | ||
|
||
You have been tasked to check if the robot invaded a rectangular area formed by | ||
four cardinal points ($A$, $B$, $C$ and $D$). Will be informed the four cardinal | ||
points of a plan as shown. The area is formed by connecting the four points as | ||
follows $AB$, $BC$, $CD$ and $DA$. The $X$, $Y$ coordinate of the robot will be | ||
informed | ||
|
||
<center> | ||
<img src="imgs/colisao.jpg"> | ||
</center> | ||
|
||
## Input | ||
|
||
The input consists of several test cases. The first line is formed by a number | ||
$N$ indicating the total number of test cases. The next $N$ lines consist of 10 | ||
integers ($A_x$, $A_y$, $B_x$, $B_y$, $C_x$, $C_y$, $D_x$, $D_y$, $R_X$, $R_Y$) | ||
representing each of the vertices $A$, $B$, $C$ and $D$ and the location $X$, | ||
$Y$ robot. Each value is separated by a blank space. | ||
|
||
## Output | ||
|
||
The output should print for each test case, the number 1 if the robot is within | ||
the area (considering the edges of the figure as part of the area of the figure) | ||
, and print the number 0 otherwise. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ad-hoc |