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

Farmer John's Cheese Block

Silver IV 실버 IV
난이도
2s
시간 제한
256MB
메모리 제한
1
맞았습니다!!
1
제출 수
100.0%
정답률
레이팅

의견: 0

설명

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. 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.

Problem credits: Chongtian Ma, Alex Liang

제약

SCORING

  • Inputs 2-4: \(N\le 10\) and \(Q \le 1000\)
  • Inputs 5-7: \(N\le 100\) and \(Q \le 1000\)
  • Inputs 8-16: No additional constraints

Problem credits: Chongtian Ma, Alex Liang

입력 형식

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
출력
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.

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2024-2025 > December > Bronze

태그

평가 및 의견

Farmer John's Cheese Block

개요
출제자 난이도 Silver IV 실버 IV 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Farmer John's Cheese Block

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