コンテストの制限時間が終了しました。
以降も提出を行うことができますが、順位集計には反映されません。
以降も提出を行うことができますが、順位集計には反映されません。
ソースコード
SELECT LINE,SEAT_F,SEAT_T
FROM
(SELECT S1.LINE_ID AS LINE,S1.SEAT_NO AS SEAT_F,S3.SEAT_NO AS SEAT_T
FROM SEAT_RESERVE S1,SEAT_RESERVE S2,SEAT_RESERVE S3
WHERE S1.LINE_ID = 'A'
AND S2.LINE_ID = 'A'
AND S3.LINE_ID = 'A'
AND S1.RSV_STATUS = 0
AND S2.RSV_STATUS = 0
AND S3.RSV_STATUS = 0
AND S2.SEAT_NO = S1.SEAT_NO + 1
AND S3.SEAT_NO = S1.SEAT_NO + 2
UNION
SELECT S1.LINE_ID AS LINE,S1.SEAT_NO AS SEAT_F,S3.SEAT_NO AS SEAT_T
FROM SEAT_RESERVE S1,SEAT_RESERVE S2,SEAT_RESERVE S3
WHERE S1.LINE_ID = 'B'
AND S2.LINE_ID = 'B'
AND S3.LINE_ID = 'B'
AND S1.RSV_STATUS = 0
AND S2.RSV_STATUS = 0
AND S3.RSV_STATUS = 0
AND S2.SEAT_NO = S1.SEAT_NO + 1
AND S3.SEAT_NO = S1.SEAT_NO + 2
UNION
SELECT S1.LINE_ID AS LINE,S1.SEAT_NO AS SEAT_F,S3.SEAT_NO AS SEAT_T
FROM SEAT_RESERVE S1,SEAT_RESERVE S2,SEAT_RESERVE S3
WHERE S1.LINE_ID = 'C'
AND S2.LINE_ID = 'C'
AND S3.LINE_ID = 'C'
AND S1.RSV_STATUS = 0
AND S2.RSV_STATUS = 0
AND S3.RSV_STATUS = 0
AND S2.SEAT_NO = S1.SEAT_NO + 1
AND S3.SEAT_NO = S1.SEAT_NO + 2
UNION
SELECT S1.LINE_ID AS LINE,S1.SEAT_NO AS SEAT_F,S3.SEAT_NO AS SEAT_T
FROM SEAT_RESERVE S1,SEAT_RESERVE S2,SEAT_RESERVE S3
WHERE S1.LINE_ID = 'D'
AND S2.LINE_ID = 'D'
AND S3.LINE_ID = 'D'
AND S1.RSV_STATUS = 0
AND S2.RSV_STATUS = 0
AND S3.RSV_STATUS = 0
AND S2.SEAT_NO = S1.SEAT_NO + 1
AND S3.SEAT_NO = S1.SEAT_NO + 2
UNION
SELECT S1.LINE_ID AS LINE,S1.SEAT_NO AS SEAT_F,S3.SEAT_NO AS SEAT_T
FROM SEAT_RESERVE S1,SEAT_RESERVE S2,SEAT_RESERVE S3
WHERE S1.LINE_ID = 'E'
AND S2.LINE_ID = 'E'
AND S3.LINE_ID = 'E'
AND S1.RSV_STATUS = 0
AND S2.RSV_STATUS = 0
AND S3.RSV_STATUS = 0
AND S2.SEAT_NO = S1.SEAT_NO + 1
AND S3.SEAT_NO = S1.SEAT_NO + 2
)
ORDER BY LINE DESC,SEAT_F
提出情報
提出日時 | 2024/06/21 14:37:19 |
コンテスト | 第13回 SQLコンテスト |
問題 | 空席検索 |
受験者 | vhaeivoia7638 |
状態 (詳細) | AC (Accepted: 正答) |
メモリ使用量 | 84 MB |
メッセージ
テストケース(通過数/総数)
3/3
状態
メモリ使用量
データパターン1
AC
83 MB
データパターン2
AC
84 MB
データパターン3
AC
83 MB