ソースコード

SELECT 
  RANK() OVER(ORDER BY SUM(a.POINT) DESC) AS RANK,
  b.USER_ID AS USER_ID,
  SUM(a.POINT) AS POINT,
  ( 
  SELECT 
  (strftime('%s', MAX(c.SUBMITTED_AT)) - strftime('%s', d.STARTED_AT) ) 
    + 300 * (SUM(CASE WHEN STATUS="WA" THEN 1 ELSE 0 END))
FROM SUBMISSIONS AS c
INNER JOIN ENTRIES AS d ON d.ENTRY_ID = c.ENTRY_ID
WHERE d.USER_ID = a.USER_ID AND c.CONTEST_ID = 2 AND c.ENTRY_ID IS NOT NULL
    GROUP BY d.USER_ID
, d.CONTEST_ID
    ) AS EX_TIME,
  ( 
  SELECT 
    (SUM(CASE WHEN STATUS="WA" THEN 1 ELSE 0 END))
FROM SUBMISSIONS AS c
INNER JOIN ENTRIES AS d ON d.ENTRY_ID = c.ENTRY_ID
WHERE d.USER_ID = a.USER_ID AND c.CONTEST_ID = 2 AND c.ENTRY_ID IS NOT NULL
    GROUP BY d.USER_ID
, d.CONTEST_ID
    ) AS WRONG_ANS
FROM ENTRIES AS b
INNER JOIN SUBMISSIONS AS a ON a.ENTRY_ID = b.ENTRY_ID
AND a.CONTEST_ID = b.CONTEST_ID 
AND a.USER_ID = b.USER_ID
WHERE a.CONTEST_ID = 2 AND a.ENTRY_ID IS NOT NULL
GROUP BY b.USER_ID
-- , PROBLEM_ID
ORDER BY
    RANK ASC
    , WRONG_ANS ASC
    , USER_ID ASC;
    
提出情報
提出日時2022/10/20 04:12:23
コンテスト第3回 SQLコンテスト
問題順位計算
受験者mokomoko
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量94 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
78 MB
データパターン2
WA
94 MB