結果

問題 No.18 うーさー暗号
ユーザー 💕💖💞💕💖💞
提出日時 2017-07-08 14:34:07
言語 Kotlin
(1.9.10)
結果
AC  
実行時間 304 ms / 5,000 ms
コード長 422 bytes
コンパイル時間 12,426 ms
コンパイル使用メモリ 416,452 KB
実行使用メモリ 53,336 KB
最終ジャッジ日時 2023-08-12 20:26:21
合計ジャッジ時間 16,698 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 292 ms
52,872 KB
testcase_01 AC 297 ms
53,116 KB
testcase_02 AC 295 ms
53,060 KB
testcase_03 AC 304 ms
53,008 KB
testcase_04 AC 302 ms
53,184 KB
testcase_05 AC 298 ms
53,136 KB
testcase_06 AC 299 ms
53,148 KB
testcase_07 AC 304 ms
53,068 KB
testcase_08 AC 301 ms
53,108 KB
testcase_09 AC 298 ms
53,300 KB
testcase_10 AC 282 ms
53,292 KB
testcase_11 AC 284 ms
53,336 KB
testcase_12 AC 290 ms
53,004 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:1:11: warning: parameter 'args' is never used
fun main( args : Array<String> ) {
          ^
Main.kt:9:9: warning: variable 'd' is never used
    val d = i%26
        ^

ソースコード

diff #

fun main( args : Array<String> ) {
  val m = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toList().mapIndexed { i,x ->
     Pair(i, x)
  }.toMap()
  val os = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".toList().mapIndexed { i,x ->
     Pair(x, i)
  }.toMap()
  readLine()!!.toList().mapIndexed { i,x ->
    val d = i%26
    val ii = (26*100 + os[x]!! - i - 1)%26
    //println("$i $d ${m[ii]} ${ii}")
    m[ii]
  }.joinToString("").let { println(it) }
}
0