포럼
문제 ICPC00322

F. Find my Family

설명

You are looking for a particular family photo with you and your favorite relatives Alice and Bob. Each family photo contains a line-up of \(n\) people. On the photo you're looking for, you remember that Alice, who is taller than you, was somewhere on your left from the perspective of the photographer. Also, Bob who is taller than both you and Alice, was standing somewhere on your right.

Since you have a large number of family photos, you want to use your computer to assist in finding the photo. Many of the photos are quite blurry, so facial recognition has proven ineffective. Luckily, the Batch Apex Photo Classifier, which detects each person in a photo and outputs the sequence of their (distinct) heights in pixels, has produced excellent results. Given this sequence of heights for \(k\) photos, determine which of these photos could potentially be the photo you're looking for.

제약
입력 형식
  • The first line contains \(1\leq k\leq 1000\), the number of photos you have to process.
  • Then follow two lines for each photo.
  • The first line contains a single integer $3 \leq n \leq 3\cdot
    10^5$, the number of people on this photo.
  • The second line contains \(n\) distinct integers $1\leq h_1,
    \dots, h_n \leq 10^9$, the heights of the people in the photo, from left to right.

It is guaranteed that the total number of people in all photos is at most \(3\cdot 10^5\).

출력 형식
  • On the first line, output the number of photos \(k\) that need further investigation.
  • Then print \(k\) lines each containing a single integer \(1\leq a_i \leq n\), the sorted indices of the photos you need to look at.
예제 1
입력
1
3
2 1 3
출력
1
1
예제 2
입력
4
4
140 157 160 193
5
15 24 38 9 30
6
36 12 24 29 23 15
6
170 230 320 180 250 210
출력
2
2
4
문제 정보

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

출처 ICPC BAPC 2019

평가 및 의견

F. Find my Family

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

Log in to rate problems.

개별 의견

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

풀이 제출

F. Find my Family

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