ソースコード
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
,COALESCE(SUM(TIME_SUM + 300*MISS),0) TIME_SUM
,COALESCE(SUM(MISS),0) MISS
FROM
(SELECT ENTRIES.CONTEST_ID CONTEST_ID
,ENTRIES.ENTRY_ID ENTRY_ID
,ENTRIES.USER_ID USER_ID
,PROBLEM_ID
,SUBMITTED_AT
,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'
AND strftime('%s',SUBMITTED_AT)-strftime('%s',STARTED_AT)>0) A
LEFT JOIN
(SELECT ENTRIES.CONTEST_ID CONTEST_ID
,ENTRIES.ENTRY_ID ENTRY_ID
,ENTRIES.USER_ID USER_ID
,PROBLEM_ID
,SUBMITTED_AT
,COUNT(*) MISS
FROM ENTRIES
JOIN SUBMISSIONS
ON ENTRIES.ENTRY_ID  = SUBMISSIONS.ENTRY_ID 
WHERE ENTRIES.CONTEST_ID = 2
AND STATUS <> 'AC'
GROUP BY ENTRIES.ENTRY_ID,ENTRIES.USER_ID
,PROBLEM_ID) B
ON A.ENTRY_ID = B.ENTRY_ID
WHERE A.SUBMITTED_AT > B.SUBMITTED_AT
GROUP BY A.USER_ID
HAVING SUM(POINT)>0)

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