ソースコード
with TMP as (
    select
        row_number() over(partition by E.USER_ID, S.PROBLEM_ID order by SUBMITTED_AT asc) - 1  as PEN
        , S.POINT
        , S.SUBMITTED_AT
        , S.STATUS
        , E.USER_ID
        , E.STARTED_AT
    from ENTRIES as E
    inner join SUBMISSIONS as S
        on E.ENTRY_ID=S.ENTRY_ID and S.ENTRY_ID is not null
    where E.CONTEST_ID=2
)

select
    rank() over(order by POINT desc, EX_TIME asc) as RANK
    , *
from (select
        USER_ID
        , sum(POINT) as POINT
        , 300*sum(PEN) + strftime('%s', max(SUBMITTED_AT)) - strftime('%s', min(STARTED_AT)) as EX_TIME
        , sum(PEN) as WRONG_ANS  
    from TMP
    where STATUS='AC'
    group by USER_ID)
where POINT>0
order by RANK, WRONG_ANS, USER_ID;
提出情報
提出日時2024/10/08 11:20:17
コンテスト第3回 SQLコンテスト
問題順位計算
受験者poapoa1010
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量86 MB
メッセージ
テストケース(通過数/総数)
1/2
状態
メモリ使用量
データパターン1
AC
84 MB
データパターン2
WA
86 MB