Contest Participants with Long Totals and Short Questions
Problem statement
Return the names of participants whose total recorded question-solving time is more than 30 minutes and whose every recorded question took at most 10 minutes. Sort by total time ascending, then participant ID ascending to break ties.
For this exercise, participants.id joins to submissions.participant_id. Each submission row represents one completed question for that participant, and all judgement values count. Repeated submissions for the same question are outside this practice dataset. Measure duration as ended_at minus started_at in whole seconds.
Participants with no submissions do not qualify. Different participants with the same name each keep their own result row. Return one column named participant_name; total time is used for filtering and ordering but is not an output column.
Table schema
Use the same input data with any supported language. Open the Schema tab in the editor to see the generated SQL setup or Pandas DataFrames.
participants
One row per participant. Names may repeat.
| Column | Type | Nullable | Description |
|---|---|---|---|
| idPK | Integer | No | Participant identifier. |
| name | Text | No | Participant name. |
| group_name | Text | No | Reported group; it does not affect this query. |
submissions
Each row is one completed question for one participant; repeated question rows are outside this exercise. All judgements count.
| Column | Type | Nullable | Description |
|---|---|---|---|
| submission_idPK | Integer | No | Unique submission identifier. |
| participant_id | Integer | No | Participant owning this completed question. |
| started_at | Timestamp | No | Whole-second UTC start time. |
| ended_at | Timestamp | No | Whole-second UTC end time, not earlier than start. |
| judgement | Text | No | Recorded judgement; no acceptance filter applies. |
Foreign key: participant_id → participants(id)
Expected result
Your query or function must return these columns.
| Column | Type | Nullable | Description |
|---|---|---|---|
| participant_name | Text | No | One row per qualifying participant, with duplicate names retained. |
Row order: must match exactly. Numeric tolerance: 0.
Constraints
- All columns are non-null and each table follows its declared primary and foreign keys.
- Timestamps are whole-second UTC instants and ended_at is not earlier than started_at.
- The total bound is strictly greater than 1800 seconds; the individual bound is inclusive at 600 seconds.
- Names need not be unique.