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

F. Flight Collision

설명

The Icelandic Corporation for Parcel Circulation is the leading carrier for transporting goods between Iceland and the rest of the world. Their newest innovation is a drone link connecting to mainland Europe that has a number of drones travelling back and forth along a single route.

The drones are equipped with a sophisticated system that allows them to fly evasive manoeuvres whenever two drones come close to each other. Unfortunately, a software glitch has caused this system to break down and now all drones are flying along the route with no way of avoiding collisions between them.

For the purposes of this problem, the drones are considered as points moving along an infinite straight line with constant velocity. Whenever two drones are at the same location, they will collide, causing them to fall off their flight path and plummet into the Atlantic Ocean. The flight schedule of the drones is guaranteed to be such that at no point will there be three or more drones colliding at the same location.

You know the current position of each drone as well as their velocities. Your task is to assess the damage caused by the system failure by finding out which drones will continue flying indefinitely without crashing.

제약
입력 형식

The input consists of:
- One line with an integer \(n\) (\(1 \leq n \leq 10^5\)), the number of drones. The drones are numbered from \(1\) to \(n\).
- \(n\) lines, the \(i\)th of which contains two integers \(x_i\) and \(v_i\) (\(-10^9 \leq x_i,v_i \leq 10^9\)), the current location and the velocity of the \(i\)th drone along the infinite straight line.

The drones are given by increasing \(x\) coordinate and no two drones are currently in the same position, i.e. \(x_i < x_{i+1}\) for each \(i\). You may assume that there will never be a collision involving three or more drones.

출력 형식

Output the number of drones that never crash, followed by the indices of these drones in numerically increasing order.

예제 1
입력
3
10 15
30 5
50 -1
출력
1
3
예제 2
입력
6
0 3
2 2
3 1
4 3
5 2
6 3
출력
2
1 6
문제 정보

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

출처 ICPC NWERC 2020

평가 및 의견

F. Flight Collision

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

Log in to rate problems.

개별 의견

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

풀이 제출

F. Flight Collision

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