ソースコード
with tmp1 as(
select USER_ID,CONTEST_ID,PROBLEM_ID,SUBMITTED_AT,point,
   max(case status when 'AC' then SUBMITTED_AT end)
   over(partition by USER_ID,PROBLEM_ID) as ACTime
  from SUBMISSIONS
 where ENTRY_ID is not null
   and CONTEST_ID = 2),
tmp2 as (
select USER_ID,
max(ACTime) as maxACTime,
sum(case when SUBMITTED_AT < ACTime
         then 1 else 0 end) as WACnt,
sum(point) as SumPoint,
(select STARTED_AT
   from ENTRIES b
  where b.CONTEST_ID = a.CONTEST_ID
    and b.USER_ID = a.USER_ID) as STARTED_AT
  from tmp1 a
 where ACTime is not null
 group by USER_ID
 having SumPoint > 0),
tmp3 as(
select *,strftime('%s',datetime(maxACTime))
       - strftime('%s',datetime(STARTED_AT)) as EX_TIME
 from tmp2)
select rank() over(order by SumPoint desc, EX_TIME + WACnt * 300) as RANK,
USER_ID,SumPoint as POINT,EX_TIME, WACnt as WRONG_ANS
  from tmp3
order by RANK,WRONG_ANS,USER_ID
提出情報
提出日時2022/10/20 05:57:37
コンテスト第3回 SQLコンテスト
問題順位計算
受験者AketiJyuuzou
状態 (詳細)WA
(Wrong Answer: 誤答)
メモリ使用量77 MB
メッセージ
テストケース(通過数/総数)
0/2
状態
メモリ使用量
データパターン1
WA
77 MB
データパターン2
WA
77 MB