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

S2. High Tide, Low Tide

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

의견: 0

설명

Time limit: 1
second

Joe Coder is camping near the Bay of Fundy between Nova Scotia and
New Brunswick. When he arrived at the bay, he was told that the
difference in height between high tide and low tide at the Bay of Fundy
was the largest tidal difference in the world. Ever the skeptic, Joe
decided to verify this. He chose a reference point and, after learning
from the radio when the tides were highest and lowest, he went with a
boat to his reference point and measured the depth of the water.
Unfortunately, on the last day of his trip, a strong wind scattered his
measurements.

Joe has recovered all of his measurements, but they may not be in
their original order. Luckily, he remembers some things about his
measurements:

  • He started measuring water levels at a low tide, his second
    measurement was of the water level at high tide, and after that the
    measurements continued to alternate between low and high tides.

  • All high tide measurements were higher than all low tide
    measurements.

  • Joe noticed that as time passed, the high tides only became
    higher and the low tides only became lower.

Given Joe’s measurements in no particular order, you must reconstruct
the correct order in which the measurements were taken.

제약

\((1 \leq N \leq 100)\)

입력 형식

The first line contains the integer \(N\) \((1 \leq N \leq 100)\). The next line contains \(N\) distinct space-separated positive
integers, where each integer is at most \(1\ 000\ 000\).

출력 형식

Output the \(N\) integers in the
unique order that Joe originally took the measurements.

예제 1
입력
8
10 50 40 7 3 110 90 2
출력
10 40 7 50 3 90 2 110
설명

The low tide measurements (in order) were 10, 7, 3, and 2. The high
tide measurements (in order) were 40, 50, 90, and 110.

문제 정보

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

출처 CCC 2017 Senior

평가 및 의견

S2. High Tide, Low Tide

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

Log in to rate problems.

개별 의견

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

풀이 제출

S2. High Tide, Low Tide

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