Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
You are given an attendance list of a class. Suppose that there are some students attend all lessons, and every student joinned at least one lessons.
Your task is to write a program to print out class's start time, attendance rate.
Input
The first line contains an integer ~M~ – attendance list size ~(1 \leq M \leq 10^5)~.
Each line in the next ~M~ lines represents ~3~ integers: class's start time (in milliseconds format), student ID and class ID followed by a boolean isCheckin (~0~ - absence or ~1~ - present) . All integers don't exceed ~10^{18}~.
Output
- The required sorted list. Each line in the output contains class's start time, attendance rate (rounded to ~2~ decimal places,
String.format("%.2f",…))
. The list should be sorted in descending order of attendance rate and ascending order of class's start time.
Sample Input
5
1656894600000 001 0001 1
1656894600000 002 0001 1
1657153800000 001 0001 1
1657499400000 001 0001 1
1657499400000 002 0001 0
Sample Output
1656894600000 1.00
1657153800000 0.50
1657499400000 0.50
Bình luận