結果
| 問題 |
No.1335 1337
|
| コンテスト | |
| ユーザー |
semisagi
|
| 提出日時 | 2021-01-15 22:07:35 |
| 言語 | Swift (6.0.3) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 893 bytes |
| コンパイル時間 | 14,088 ms |
| コンパイル使用メモリ | 182,032 KB |
| 実行使用メモリ | 15,616 KB |
| 最終ジャッジ日時 | 2024-11-26 15:01:36 |
| 合計ジャッジ時間 | 14,242 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 14 |
ソースコード
import Foundation
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 T = [Character](scanner.next())
let S = scanner.next().map { (c) -> Character in
if c.isNumber {
return T[Int(String(c))!]
} else {
return c
}
}
print(String(S))
semisagi