ソースコード
WITH PENA AS(
SELECT S.ENTRY_ID,
COUNT SUBMIT_ID as WRONG
FROM SUBMISSIONS as S
INNER JOIN (
SELECT ENTRY_ID,
PROBLEM_ID,
MAX(SUBMITTED_AT) as LAST
FROM SUBMISSIONS
WHERE STATUS='AC'
and ENTRY_ID is not null
and CONTEST_ID=2
GROUP BY ENTRY_ID,PROBLEM_ID
)as SUB
ON S.ENTRY_ID=SUB.ENTRY_ID
and S.PROBLEM_ID=SUB.PROBLEM_ID
and S.SUBMITTED_AT<SUB.LAST
GROUP BY S.ENTRY_ID),
SCORE_TIME as (
SELECT ENTRY_ID,
SUM(POINT) as POI,
MAX(SUBMITTED_AT) as LAST
FROM SUBMISSIONS as S
WHERE STATUS='AC'
and ENTRY_ID is not null
and CONTEST_ID=2
GROUP BY ENTRY_ID
)
SELECT RANK() OVER(
ORDER BY POINT DESC,
STRFTIME('%s',LAST)-STRFTIME('%s',STARTED_AT)+INFULL(WRONG,0) ASC
)as RANK
,E.USER_ID
,POINT
,STRFTIME('%s',LAST)-STRFTIME('%s',SARTED_AT)+INFULL(WRONG,0) as ans
FROM ENTRIES as e
LEFT OUTER JOIN PENA ON e.ENTRY_ID=PENA.ENTRY_ID
JOIN SCORE_TIME ON e.ENTRY_ID=SCORE_TIME.ENTRY_ID

提出情報
提出日時2024/01/31 09:08:01
コンテスト第3回 SQLコンテスト
問題順位計算
受験者doro
状態 (詳細)RE
(Runtime Error: 実行時エラー)
メモリ使用量84 MB
メッセージ
SQLITE_ERROR: near "as": syntax error
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
RE
83 MB
データパターン2
RE
84 MB