-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Bronze III] Title: 사분면, Time: 128 ms, Memory: 114328 KB -BaekjoonHub
- Loading branch information
Showing
2 changed files
with
47 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,26 @@ | ||
# [Bronze III] 사분면 - 9610 | ||
|
||
[문제 링크](https://www.acmicpc.net/problem/9610) | ||
|
||
### 성능 요약 | ||
|
||
메모리: 114328 KB, 시간: 128 ms | ||
|
||
### 분류 | ||
|
||
구현, 수학 | ||
|
||
### 문제 설명 | ||
|
||
<p>2차원 좌표 상의 여러 점의 좌표 (x,y)가 주어졌을 때, 각 사분면과 축에 점이 몇 개 있는지 구하는 프로그램을 작성하시오.</p> | ||
|
||
<p><img alt="" src="https://www.acmicpc.net/upload/images/quad.png" style="height:190px; width:292px"></p> | ||
|
||
### 입력 | ||
|
||
<p>첫째 줄에 점의 개수 n (1 ≤ n ≤ 1000)이 주어진다. 다음 n개 줄에는 점의 좌표 (x<sub>i</sub>, y<sub>i</sub>)가 주어진다. (-10<sup>6</sup> ≤ x<sub>i</sub>, y<sub>i</sub> ≤ 10<sup>6</sup>)</p> | ||
|
||
### 출력 | ||
|
||
<p>각 사분면과 축에 점이 몇 개 있는지를 예제 출력과 같은 형식으로 출력한다.</p> | ||
|
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,21 @@ | ||
case = int(input()) | ||
Q1 = Q2 = Q3 = Q4 = AXIS = 0 | ||
|
||
for _ in range(case): | ||
x, y = map(int, input().split()) | ||
if x == 0 or y == 0: | ||
AXIS += 1 | ||
elif x > 0 and y > 0: | ||
Q1 += 1 | ||
elif x < 0 and y > 0: | ||
Q2 += 1 | ||
elif x < 0 and y < 0: | ||
Q3 += 1 | ||
elif x > 0 and y < 0: | ||
Q4 += 1 | ||
|
||
print("Q1: %d" %(Q1)) | ||
print("Q2: %d" %(Q2)) | ||
print("Q3: %d" %(Q3)) | ||
print("Q4: %d" %(Q4)) | ||
print("AXIS: %d" %(AXIS)) |