結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
semisagi
|
| 提出日時 | 2020-08-14 21:22:09 |
| 言語 | Swift (6.0.3) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 2,000 ms |
| コード長 | 643 bytes |
| コンパイル時間 | 13,678 ms |
| コンパイル使用メモリ | 126,740 KB |
| 実行使用メモリ | 9,344 KB |
| 最終ジャッジ日時 | 2024-10-10 12:26:32 |
| 合計ジャッジ時間 | 13,504 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
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 {
let value = peek()
index += 1
return value
}
mutating func nextInt() -> Int {
return Int(next())!
}
mutating func nextDouble() -> Double {
return Double(next())!
}
}
var scanner = Scanner()
let N = scanner.nextInt()
print((N - 1) % 9 + 1)
semisagi