Ojou-sama wants to buy a new smartphone. She is tired of using her Nokia 3310 for 20 years. In preparation for the possibility of venturing into an isekai with a smartphone, Ojou-sama has been gathering information on which smartphones would grant her the best abilities in such a scenario. She learned that battery capacity and signal strength are the most crucial features. Help Ojou-sama filter out the good smartphones from a large list. The input consists of unique elements, and each element contains two numbers representing a smartphone's battery capacity and signal strength. Given two elements A = (X_A, Y_A), and B = (X_B, Y_B), if X_A ≥ X_B and Y_A ≥ Y_B , then A is considered better than B. Given an element A, if there is no other element better than A, then A is called a good element. Your task is to filter out all the good smartphones. Note: The output must preserve the input order.
Example 1:
Input: phones = [[1, 1],[2, 4],[2, 10],[5, 4],[4, 8],[5, 5],[8, 4],[10, 2],[10, 1]]
Output: [[2, 10],[4, 8],[5, 5],[8, 4],[10, 2]]
./
├─ BuyPhone.java # Abstract Class
├─ HW09.java # Runner
├─ HW09_4111056036_1.java # Version 1
├─ HW09_4111056036_2.java # Version 2
├─ HW09_4111056036_3.java # Version 3
├─ HW09_4111056036_4.java # Version 4
├─ HW09_4111056036_5.java # Version 5
├─ StopWatch.java # Class for Calculate Runtime
├─ build.sh # Compile Script
└─ README.md
Rank | Version | Status | Time |
---|---|---|---|
9/106 | HW09_4111056036_3 | Correct | 0.003272 |
Note: The rank is compared to the best submissions from all participants.
Rank | Version | Status | Time |
---|---|---|---|
20/213 | HW09_4111056036_3 | Correct | 0.003272 |
21/213 | HW09_4111056036_4 | Correct | 0.003301 |
22/213 | HW09_4111056036_2 | Correct | 0.003323 |
23/213 | HW09_4111056036_5 | Correct | 0.00333 |
26/213 | HW09_4111056036_1 | Correct | 0.003405 |
Note: The ranks are compared to all submissions from all participants.