포럼
문제 COCI00264

Burek

설명

\(6^{th}\) round, March \(9^{th}\), 2013

Baker Crumble has just baked N triangular burek^{2} pastries. Each pastry can be represented in the
Cartesian coordinate system as a triangle with vertices in integer coordinate points.
The baker's mischievous son Joey has just taken a large knife and started to cut the pastries. Each cut
that Joey makes corresponds to a horizontal (\(y = c\)) or vertical (\(x = c\)) line in the coordinate system.
Help the baker assess the damage caused by Joey's pastry cutting. Your task is to determine, for each
Joey's cut, how many pastries are affected (such that both the left and right parts of the cut pastry have
areas greater than zero).

제약

In test data worth at least 40 points, \(M \le 300\).
In test data worth an additional 40 points, the vertex coordinates of all triangles will be smaller than
1000.

2
Turkish/Balkanian flaky dough pastry, often filled with cheese or minced meat.
\(6^{th}\) round, March \(9^{th}\), 2013

입력 형식

The first line of input contains the positive integer N (\(2 \le N \le 100\,000\)), the number of burek pastries.
Each of the following N lines contains six nonnegative integers smaller than \(10^{6}\). These numbers are, in
order, the coordinates (x_{1}, y_{1}), (x_{2}, y_{2}), (x_{3}, y_{3}) of the three pastry-triangle vertices. The three vertices will
not all be on the same line. The pastries can touch as well as overlap.
The following line contains the positive integer M (\(2 \le M \le 100\,000\)), the number of cuts.
Each of the following M lines contains a single cut line equation: “\(x = c\)” or “\(y = c\)” (note the spaces
around the equals sign), where c is a nonnegative integer smaller than \(10^{6}\).

출력 형식

For each cut, output a line containing the required number of cut pastries.

예제 1
입력
3
1 0 0 2 2 2
1 3 3 5 4 0
5 4 4 5 4 4
4
x = 4
x = 1
y = 3
y = 1
출력
0
1
1
2
예제 2
입력
4
2 7 6 0 0 5
7 1 7 10 11 11
5 10 2 9 6 8
1 9 10 10 4 1
4
y = 6
x = 2
x = 4
x = 9
출력
3
2
3
2
문제 정보

생성자가 기록되지 않았습니다.

출처 COCI 2012/2013 Contest 6

평가 및 의견

Burek

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

Burek

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8