Logo
(追記) (追記ここまで)

33063번 - Farmer John's Cheese Block 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB37819416157.295%

문제

Farmer John has a block of cheese in the shape of a cube. It lies on the 3-dimensional coordinate plane, extending from $(0,0,0)$ to $(N, N, N)$ (2ドル \leq N \leq 1000$). Farmer John will perform a series of $Q$ (1ドル \leq Q \leq 2 \cdot 10^5$) update operations to his cheese block.

For each update operation, FJ will carve out the 1ドル$ by 1ドル$ by 1ドル$ block of cheese extending from integer coordinates $(x, y, z)$ to $(x+1, y+1, z+1),ドル where 0ドル\le x,y,z<N$. It is guaranteed that there will exist a 1ドル$ by 1ドル$ by 1ドル$ block of cheese at the location FJ carves. Since FJ is playing Moocraft, gravity does not cause parts of the cheese to fall if cheese below is carved.

After each update, output the number of distinct configurations that FJ can stick a 1ドル$ by 1ドル$ by $N$ brick in the cheese block such that no part of the brick overlaps with any remaining cheese. Every vertex of the brick must have integer coordinates in the range $[0,N]$ for all three axes. FJ may rotate the brick however he wants.

입력

The first line contains $N$ and $Q$.

The following $Q$ lines contain $x,ドル $y,ドル and $z,ドル the coordinates to be carved.

출력

After each update operation, output an integer, the number of configurations.

제한

예제 입력 1

2 5
0 0 0
1 1 1
0 1 0
1 0 0
1 1 0

예제 출력 1

0
0
1
2
5

힌트

After the first three updates, the 1ドル\times 2 \times 1$ brick spanning $[0, 1]\times [0, 2]\times [0, 1]$ does not overlap with the remaining cheese, so it contributes toward the answer.

출처

Olympiad > USA Computing Olympiad > 2024-2025 Season > USACO 2024 December Contest > Bronze 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /