ソースコード
SELECT RANK() OVER(ORDER BY POINT DESC,TIME_SUM) AS RANK
,USER_ID AS USER_ID
,POINT AS POINT
,TIME_SUM EX_TIME
,MISS WRONG_ANS

FROM
(SELECT A.USER_ID USER_ID
,SUM(A.POINT) POINT
,SUM(TIME_SUM + 300*MISS) TIME_SUM
,SUM(MISS) MISS
FROM
(SELECT ENTRIES.CONTEST_ID CONTEST_ID
,ENTRIES.ENTRY_ID ENTRY_ID
,ENTRIES.USER_ID USER_ID
,PROBLEM_ID
,strftime('%s',SUBMITTED_AT)-strftime('%s',STARTED_AT) TIME_SUM
,STATUS
,POINT
FROM ENTRIES
JOIN SUBMISSIONS
ON ENTRIES.ENTRY_ID  = SUBMISSIONS.ENTRY_ID 
WHERE ENTRIES.CONTEST_ID = 2
AND STATUS = 'AC') A
JOIN
(SELECT ENTRIES.CONTEST_ID CONTEST_ID
,ENTRIES.ENTRY_ID ENTRY_ID
,ENTRIES.USER_ID USER_ID
,PROBLEM_ID
,COUNT(*) MISS
FROM ENTRIES
JOIN SUBMISSIONS
ON ENTRIES.ENTRY_ID  = SUBMISSIONS.ENTRY_ID 
WHERE ENTRIES.CONTEST_ID = 2
AND STATUS <> 'AC'
GROUP BY ENTRIES.USER_ID
,PROBLEM_ID) B
ON A.ENTRY_ID = B.ENTRY_ID
GROUP BY A.USER_ID)

ORDER BY RANK,WRONG_ANS,USER_ID
提出情報
提出日時2022/10/20 00:04:22
コンテスト第3回 SQLコンテスト
問題順位計算
受験者neene
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量95 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
95 MB
データパターン2
WA
93 MB