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

Planete

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
Platinum I 플래티넘 I
난이도
1s
시간 제한
32MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

European Space Agency has \(N\) telescopes observing distant planets. They classified \(M\) different types of events. They noticed that every day on each planet there is exactly one type of event. They measure events in days because they discovered each event lasts at least one day, and at most \(365\) days. Events last only complete number of days, they never last fractional part of a day. Each event of the same type lasts exactly the same number of days every time it occurs, regardless of the planet it occurs on.

After many years of observation they want to analyze data. The telescopes logged all observations, but unfortunately they forgot to write down the year the observations took place! Each telescope entry consists of start date, end date and number of each type of events observed. Given all observations on all planets, calculate the duration of each type of event. Note that the telescopes are super precise and they start working exactly when the event starts and end when an event ends, not necessarily the same one.

Note: for this task, each year has exactly \(365\) days.

제약
입력 형식

First line contains integers \(N\) and \(M\) (\(1 \le N, M \le 200\)), number of telescopes and number of event types. Next \(N\) lines contain \(M+4\) numbers each:

$$ D_1 D_1\ M_1 M_1\ D_2 D_2\ M_2 M_2\ F_1\ F_2\ \ldots\ F_M $$

Where \(D_1 D_1\ M_1 M_1\) (\(01 \le DD \le 31\), \(01 \le MM \le 12\)) are the start date, \(D_2 D_2\ M_2 M_2\) the end date, and \(F_i\) (\(0 \le F_i \le 200\)) the number of times event type \(i\) was observed.

출력 형식

One line containing \(M\) numbers, durations of event types. If more than one solution exists, output any one. If no solution exists, output -1.

First sample description: Telescope observed one type \(1\) event between \(26\). February and \(3\). March. The only possible explanation is that type \(1\) events last \(5\) days.

서브태스크
서브태스크점수설명

Test 1

10점

None

Test 2

10점

None

Test 3

10점

None

Test 4

10점

None

Test 5

10점

None

Test 6

10점

None

Test 7

10점

None

Test 8

10점

None

Test 9

10점

None

Test 10

10점

None

예제 1
입력
1 1
26 02 03 03 1
출력
5
예제 2
입력
1 1
26 02 03 03 2
출력
185
예제 3
입력
3 3
22 03 01 10 9 10 10
05 05 16 12 1 7 10
20 06 15 01 4 9 10
출력
102
204
125
문제 정보

riseoj 작성

출처 COCI 2009/2010 Contest 3

평가 및 의견

Planete

개요
출제자 난이도 Platinum I 플래티넘 I 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Planete

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