結果

問題 No.1305 Speak of the Devil
ユーザー semisagisemisagi
提出日時 2020-12-04 23:49:18
言語 Swift
(5.10.0)
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 749 bytes
コンパイル時間 8,103 ms
コンパイル使用メモリ 129,588 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-10-13 12:18:17
合計ジャッジ時間 10,099 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,696 KB
testcase_01 AC 3 ms
7,692 KB
testcase_02 AC 4 ms
7,752 KB
testcase_03 AC 4 ms
7,708 KB
testcase_04 AC 3 ms
7,708 KB
testcase_05 AC 4 ms
7,716 KB
testcase_06 AC 3 ms
7,708 KB
testcase_07 AC 4 ms
7,704 KB
testcase_08 AC 3 ms
7,724 KB
testcase_09 AC 3 ms
7,740 KB
testcase_10 AC 3 ms
7,692 KB
testcase_11 AC 4 ms
7,704 KB
testcase_12 AC 3 ms
7,768 KB
testcase_13 AC 3 ms
7,904 KB
testcase_14 AC 3 ms
7,792 KB
testcase_15 AC 3 ms
7,748 KB
testcase_16 AC 3 ms
7,820 KB
testcase_17 AC 3 ms
7,824 KB
testcase_18 AC 3 ms
7,820 KB
testcase_19 AC 3 ms
7,796 KB
testcase_20 AC 3 ms
7,748 KB
testcase_21 AC 3 ms
7,768 KB
testcase_22 AC 3 ms
7,744 KB
testcase_23 AC 3 ms
7,800 KB
testcase_24 AC 3 ms
7,800 KB
testcase_25 AC 4 ms
7,764 KB
testcase_26 AC 3 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

struct Scanner {
    private var elements = [String]()
    private var index = 0

    mutating func peek() -> String {
        while elements.count == index {
            elements = readLine()!.split(separator: " ").map(String.init)
            index = 0
        }
        return elements[index]
    }

    mutating func next() -> String {
        defer { index += 1 }
        return peek()
    }

    mutating func nextInt() -> Int {
        return Int(next())!
    }

    mutating func nextInts(_ n: Int) -> [Int] {
        return (0 ..< n).map { _ in nextInt() }
    }

    mutating func nextDouble() -> Double {
        return Double(next())!
    }
}

var scanner = Scanner()
let p = scanner.nextInt()
let q = scanner.nextInt()
print(min(p, q))
0