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

Preokret

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

의견: 0

설명

1 \(s / 64\) \(MB / 50\) points

If they continue playing like this, soon the basketball players of the world's best league, the NBA, will

put a ball in the basket every second. So there will no longer be any defense, tactics nor basketball.
Let's imagine observing one of these future matches between Team A and Team B. We know how

many points both Team A and Team B have scored and the exact second when it happened. Within

a second, it will not be possible to score more than one point.
King James is observing the task input and wants to answer the following two questions:
1.
How many points have been scored during the first ha\(lf-ti\)me, that is in the first half of the

game, if we know that the entire game lasts \(4 \times 12\) minutes?
2.
How many "turnarounds" have happened during the match, i.e. how many times has a team

come from a losing situation (has strictly fewer points scored than the other team) to a leading

one (has strictly more points scored than the other team)?

제약

The correct output of the first line is worth 2 points, and the correct output of the second one is worth

3 points. If you do not know how to solve some part of the task, print anything in the corresponding

line.

입력 형식

The first line contains a positive integer \(A\) (1 ≤ \(A\) ≤ 2879), the number of points Team A has scored.
In the following \(A\) lines there are positive integers \(As\) (1 ≤ \(As \le 2880\)), the seconds in which Team A

was scoring points ordered from the smallest to the largest number.
In the ( \(A + 2\)) ^{th} line there is a positive integer \(B\) (1 ≤ \(B \le 2879\)), the number of points Team B has

scored. In the following \(B\) lines there are positive integers \(Bs\) (1 ≤ \(Bs \le 2880\)), the seconds in which

Team B was scoring points ordered from the smallest to the largest number.

출력 형식

In the first line print an integer value, the answer to the first question from the text of the task.
In the second line print an integer value, the answer to the second question from the text of the task.

예제 1
입력
3
10
1400
1500
2
7
2000

6
15
30
35
55
60
2065
7
20
25
11
1402
1412
1428
1430
1441
1444
1453
1483
1485


1 s / 64 MB / 50 points

40
45
50
2070
2075

1489
1490
9
1403
1405
1409
1435
1459
1460
1461
1487
1495
출력
output
output
3
1

10
5

8
2
설명

Clarification of the second example:

Results’ progress
„Team A : Team B“
Turnaround (YES/NO)
1:0 (15 th second, 1 st half-time)
NO
1:1 (20 th second, 1 st half-time)
NO
1:2 (25 th second, 1 st half-time)
YES (Team B)
2:2 (30 th second, 1 st half-time)
NO
3:2 (35 th second, 1 st half-time)
YES (Team A)
3:3 (40 th second, 1 st half-time)
NO
3:4 (45 th second, 1 st half-time)
YES (Team B)
3:5 (50 th second, 1 st half-time)
NO
4:5 (55 th second, 1 st half-time)
NO
5:5 (60 th second, 1 st half-time)
NO
6:5 (2065 th second, 2 nd half-time)
YES (Team A)
6:6 (2070 th second, 2 nd half-time)
NO
6:7 (2075 th second, 2 nd half-time)
YES (Team B)

문제 정보

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

출처 COCI 2018/2019 Contest 2

평가 및 의견

Preokret

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

Log in to rate problems.

개별 의견

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

풀이 제출

Preokret

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