結果

問題 No.18 うーさー暗号
ユーザー toshiro_yanagitoshiro_yanagi
提出日時 2018-09-27 19:50:07
言語 Kotlin
(1.9.23)
結果
AC  
実行時間 303 ms / 5,000 ms
コード長 217 bytes
コンパイル時間 11,444 ms
コンパイル使用メモリ 433,760 KB
実行使用メモリ 58,920 KB
最終ジャッジ日時 2024-04-30 19:16:47
合計ジャッジ時間 14,167 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 260 ms
56,608 KB
testcase_01 AC 262 ms
56,692 KB
testcase_02 AC 266 ms
56,716 KB
testcase_03 AC 266 ms
58,888 KB
testcase_04 AC 265 ms
56,712 KB
testcase_05 AC 275 ms
56,636 KB
testcase_06 AC 268 ms
56,624 KB
testcase_07 AC 264 ms
56,748 KB
testcase_08 AC 264 ms
58,920 KB
testcase_09 AC 303 ms
56,776 KB
testcase_10 AC 264 ms
56,624 KB
testcase_11 AC 263 ms
56,604 KB
testcase_12 AC 271 ms
56,756 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() ?: return
	var ans = ""

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