結果

問題 No.18 うーさー暗号
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-09-27 20:13:11
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 309 ms / 5,000 ms
コード長 235 bytes
コンパイル時間 10,292 ms
コンパイル使用メモリ 428,200 KB
実行使用メモリ 57,168 KB
最終ジャッジ日時 2024-04-30 19:17:32
合計ジャッジ時間 15,377 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 295 ms
57,168 KB
testcase_01 AC 302 ms
56,872 KB
testcase_02 AC 295 ms
57,116 KB
testcase_03 AC 307 ms
57,148 KB
testcase_04 AC 301 ms
56,952 KB
testcase_05 AC 303 ms
57,060 KB
testcase_06 AC 307 ms
57,148 KB
testcase_07 AC 308 ms
56,916 KB
testcase_08 AC 309 ms
57,092 KB
testcase_09 AC 306 ms
57,100 KB
testcase_10 AC 297 ms
57,024 KB
testcase_11 AC 299 ms
56,976 KB
testcase_12 AC 299 ms
57,052 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.kt:4:10: warning: parameter 'args' is never used
fun main(args: Array<String>) {
         ^

ソースコード

diff #

val dic = ('A'..'Z').toList()
val n = dic.size

fun main(args: Array<String>) {
	val S = readLine()?.toMutableList() ?: return

	S.forEachIndexed { i, v ->
		S[i] = dic[((v - 'A' - i - 1) % n + n) % n]
	}
	println(S.joinToString(""))
}
0