ソースコード
select
    RANK() OVER ( 
        ORDER BY
            POINT DESC
            , strftime('%s', SUBMITTED_AT) - strftime('%s', STARTED_AT) + EX_TIME_PENA ASC
    ) AS RANK
    , USER_ID
    , POINT
    , strftime('%s', SUBMITTED_AT) - strftime('%s', STARTED_AT) + EX_TIME_PENA AS EX_TIME
    , WRONG_ANS 
from
    ( 
        select
            S.USER_ID
            , SUM(S.POINT) AS POINT
            , MIN(E.STARTED_AT) AS STARTED_AT
            , MAX( 
                CASE 
                    WHEN S.STATUS = 'AC' 
                        THEN S.SUBMITTED_AT 
                    ELSE NULL 
                    END
            ) AS SUBMITTED_AT
            , SUM(CASE WHEN S.STATUS = 'WA' THEN 300 ELSE 0 END) AS EX_TIME_PENA
            , SUM(CASE WHEN S.STATUS = 'WA' THEN 1 ELSE 0 END) AS WRONG_ANS 
        from
            SUBMISSIONS as S 
            inner join ENTRIES as E 
                on E.ENTRY_ID = S.ENTRY_ID 
        group by
            S.USER_ID
    )
order by
    RANK
    , WRONG_ANS
    , USER_ID
提出情報
提出日時2024/11/01 15:12:43
コンテスト第3回 SQLコンテスト
問題順位計算
受験者kawano
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量85 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
85 MB
データパターン2
WA
85 MB