RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
COCI00361

Topovi

Unrated 레이팅 미적용
난이도
2s
시간 제한
64MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

\(1^{st}\) round, October \(17^{th}\), 2015

Mirko is a huge fan of chess and programming, but typical chess soon became boring for him, so he
started having fun with rook pieces.
He found a chessboard with N rows and N columns and placed K rooks on it.
Mirko’s game is made of the following rules:
1. Each rook’s power is determined by an integer.
2. A rook sees all the fields that are in his row or column except its own field.
3. We say that a field is attacked if the binary XOR of all the powers of the rooks that see the field
is greater than 0.
Notice that the field a rook is at can be attacked or not.
Initially, Mirko placed the rooks in a certain layout on the board and will make P moves.
After each move, determine how many fields are attacked.
Every rook can be moved to any free field on the whole board (not only across column and row).

제약

In test cases worth 25% of total points, N and K will not exceed 100.

입력 형식

The first line of input contains integers N, K, P (\(1 \le N \le 1\,000\,000\,000\), \(1 \le K \le 100\,000\), \(1 \le P\)
100 000).
Each of the following K lines contains three integers R, C, X (\(1 \le R\), \(C \le N\), \(1 \le X \le 1\,000\,000\,000\))
which denote that initially there is a rook of power X on the field (R, C).
Each of the following P lines contains four integers R1, C1, R2, C2 (\(1 \le R\)1, C1, R2, C\(2 \le N\)) which
denote that the rook has moved from field (R1, C1) to field (R2, C2).
It is guaranteed that there will not be two rooks on one field at any point.

출력 형식

The output must consist of P lines, the k^{th} line containing the total number of attacked fields after k
moves.

예제 1
입력
3 3 4
1 1 1
2 2 2
2 3 3
2 3 3 3
3 3 3 1
1 1 1 2
3 1 3 2
출력
4
0

output

4
2

output

6
7
7
9
설명

Clarification of the first example: After the first move, every field on the board is attacked.
For example, field (1, 1) is seen by only one rook so the total XOR for that field is 1. After the second
move none of the fields are attacked. For example, field (1,1) is seen by both rooks so the total XOR
for that field is 0.

문제 정보

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

출처 COCI 2015/2016 Contest 1

평가 및 의견

Topovi

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

Log in to rate problems.

개별 의견

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

풀이 제출

Topovi

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