포럼
문제 ICPC00376

F. Freestyle Masonry

설명

Fred got a simple task, he just has to build a \(w\times h\) wall. To make this even easier, he was provided with enough \(2\times1\) bricks and also a few \(1\times1\) bricks to complete the wall. Knowing that this task should not be too hard, Fred went to work and started building the wall without thinking too much about the design. Only when he ran out of \(1\times1\) bricks, Fred noticed that this might have been a bad idea...

Maybe he should have made a plan before starting to build the wall, but now it is too late. Fred only has a bunch of \(2\times1\) bricks left and wants to finish the wall. Can he still complete it with the remaining \(2\times 1\) bricks? Note that the wall to be built should have a width of exactly \(w\) units and a height of exactly \(h\) units.

제약
입력 형식

The input consists of:
- One line with two integers \(w\) and \(h\) (\(1\leq w\leq2\cdot10^5\), \(1\leq h\leq10^6\)), the width and height of the wall Fred wants to build.
- One line with \(w\) integers \(h_1,\dots,h_n\) (\(0\leq h_i\leq 10^6\)), where \(h_i\) is the current height of the wall at position \(i\).

출력 형식

Output "possible" if Fred can complete his wall and "impossible" otherwise.

예제 1
입력
3 3
0 0 1
출력
possible
예제 2
입력
6 3
1 0 1 1 0 1
출력
possible
예제 3
입력
6 2
1 0 1 1 0 1
출력
impossible
예제 4
입력
5 2
1 2 3 2 2
출력
impossible
문제 정보

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

출처 ICPC GCPC 2023

평가 및 의견

F. Freestyle Masonry

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

Log in to rate problems.

개별 의견

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

풀이 제출

F. Freestyle Masonry

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