結果

問題 No.18 うーさー暗号
ユーザー MOD9cXWdOsRxvPyMOD9cXWdOsRxvPy
提出日時 2022-10-31 21:11:21
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 472 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 5,324 KB
実行使用メモリ 12,048 KB
最終ジャッジ日時 2023-09-22 18:06:56
合計ジャッジ時間 1,582 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
11,708 KB
testcase_01 AC 21 ms
11,616 KB
testcase_02 AC 22 ms
11,548 KB
testcase_03 AC 22 ms
12,016 KB
testcase_04 AC 25 ms
11,892 KB
testcase_05 AC 23 ms
11,792 KB
testcase_06 AC 24 ms
11,788 KB
testcase_07 AC 22 ms
12,048 KB
testcase_08 AC 22 ms
11,972 KB
testcase_09 AC 22 ms
11,864 KB
testcase_10 AC 22 ms
11,820 KB
testcase_11 AC 20 ms
11,604 KB
testcase_12 AC 21 ms
11,988 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define cchar-clist (string-split "ZYXWVUTSRQPONMLKJIHGFEDCBA" ""))

(set-cdr! (last-pair cchar-clist) cchar-clist)

(define (char-shift c x)
  (car (drop (member c cchar-clist) x))
  )

(define (decode str)
  (define (dec-iter i sl r)
    (if (null? sl) (string-join (reverse r) "")
	(dec-iter
	 (+ i 1)
	 (cdr sl)
	 (cons (char-shift (car sl) i) r)))
    )
   (dec-iter 1 (string-split str "") ())
  )

(define (main _)
  (display (decode (read-line)))
  (newline)
  0)
0