結果

問題 No.2789 hako111223’s Master Thesis
コンテスト
ユーザー Yuzu Mashiro
提出日時 2024-06-25 15:27:41
言語 Swift
(6.2.4)
コンパイル:
swiftc _filename_ -Ounchecked -o a.out
実行:
./a.out
結果
AC  
実行時間 4 ms / 2,000 ms
+ 453µs
コード長 247 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,386 ms
コンパイル使用メモリ 142,152 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2026-07-29 22:36:34
合計ジャッジ時間 3,643 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

let buf = readLine()!.split(separator: " ").map { Int($0)! }
let (a, b, c, d) = (buf[0], buf[1], buf[2], buf[3])

let remine = (31 - a) + b
var ans = 0

if remine >= c {
  ans = 1
} else if remine >= d {
  ans = 2
} else {
  ans = 3
}

print(ans)
0