ソースコード
with W as (select s2.USER_ID,COUNT(*) as WRONG_ANS
from SUBMISSIONS s2
where s2.STATUS='WA'
and s2.SUBMITTED_AT<
(select s.SUBMITTED_AT
from ENTRIES e
inner join SUBMISSIONS s
on e.ENTRY_ID=s.ENTRY_ID
where e.CONTEST_ID=2
and s.STATUS='AC'
and s.USER_ID=s2.USER_ID
and s.PROBLEM_ID=s2.PROBLEM_ID)
group by s2.USER_ID)
,P as (select e.ENTRY_ID,e.USER_ID,e.STARTED_AT,s.PROBLEM_ID,s.SUBMITTED_AT,s.STATUS,s.POINT,
(CASE when s.STATUS='AC' then strftime('%s', s.SUBMITTED_AT) - strftime('%s', e.STARTED_AT) else 0 END) as P
from ENTRIES e
inner join SUBMISSIONS s
on e.ENTRY_ID=s.ENTRY_ID
where e.CONTEST_ID=2
and s.STATUS='AC')
select RANK() over(ORDER by POINT DESC) as RANK
,E.USER_ID as USER_ID
,P.POINT as POINT
,P.POINT+300*W.WRONG_ANS as EX_TIME
,W.WRONG_ANS as WRONG_ANS 
from ENTRIES E
inner join W
on E.USER_ID=W.USER_ID
inner join P
on E.USER_ID=P.USER_ID
order by RANK,WRONG_ANS,USER_ID
提出情報
提出日時2022/10/21 07:28:54
コンテスト第3回 SQLコンテスト
問題順位計算
受験者tk555
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量77 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
76 MB
データパターン2
WA
77 MB