結果
| 問題 |
No.565 回転拡大
|
| コンテスト | |
| ユーザー |
💕💖💞
|
| 提出日時 | 2018-06-28 12:59:58 |
| 言語 | Kotlin (2.1.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,139 bytes |
| コンパイル時間 | 15,227 ms |
| コンパイル使用メモリ | 447,220 KB |
| 実行使用メモリ | 55,412 KB |
| 最終ジャッジ日時 | 2024-11-20 16:28:53 |
| 合計ジャッジ時間 | 29,034 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 2 RE * 11 |
コンパイルメッセージ
Main.kt:1:10: warning: parameter 'args' is never used
fun main(args:Array<String>) {
^
ソースコード
fun main(args:Array<String>) {
val (r, k) = readLine()!!.split(" ").map(String::toInt)
val (h, w) = readLine()!!.split(" ").map(String::toInt)
val orig = (1..h).map { readLine()!!.toList() }
// make base
when(r) {
0 -> (1..h).map { (1..w).map { null }.toMutableList<Char?>() }
90 -> (1..w).map { (1..h).map { null }.toMutableList<Char?>() }
180 -> (1..h).map { (1..w).map { null }.toMutableList<Char?>() }
else -> (1..w).map { (1..h).map { null }.toMutableList<Char?>() }
}.let { base ->
// 90
val lambdasy = mapOf<Int, (Int)->Int>( 0 to { y -> y }, 90 to { y -> y }, 180 to { y -> w - 1 - y}, 270 to { y -> w - 1 - y } )
val lambdasx = mapOf<Int, (Int)->Int>( 0 to { x -> x }, 90 to { x -> h - 1 - x }, 180 to { x -> h - 1 - x}, 270 to { x -> x } )
(0..w-1).map { y ->
(0..h-1).map { x ->
val transy = lambdasy[r]!!(y)
val transx = lambdasx[r]!!(x) //h -1 - x
base[transy][transx] = orig[x][y]
}
}
base.map { xs ->
(1..k).map {
xs.map { x ->
(1..k).map { print(x.toString()) }
}
println("")
}
}
}
}
💕💖💞