結果

問題 No.18 うーさー暗号
ユーザー MiyamonYMiyamonY
提出日時 2019-09-03 01:33:01
言語 Scheme
(Gauche-0.9.13)
結果
AC  
実行時間 18 ms / 5,000 ms
コード長 339 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 5,412 KB
実行使用メモリ 11,908 KB
最終ジャッジ日時 2023-08-23 07:01:42
合計ジャッジ時間 1,486 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,812 KB
testcase_01 AC 18 ms
11,812 KB
testcase_02 AC 17 ms
11,720 KB
testcase_03 AC 17 ms
11,884 KB
testcase_04 AC 17 ms
11,840 KB
testcase_05 AC 18 ms
11,908 KB
testcase_06 AC 18 ms
11,808 KB
testcase_07 AC 17 ms
11,644 KB
testcase_08 AC 18 ms
11,700 KB
testcase_09 AC 18 ms
11,804 KB
testcase_10 AC 17 ms
11,824 KB
testcase_11 AC 17 ms
11,552 KB
testcase_12 AC 18 ms
11,708 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (solve s)
  (define (aux i s)
    (if (null? s)
	'()
	(let* ((c (car s))
	       (shift (+ (modulo (- (+ (- (char->integer c) (char->integer #\A)) 26) i) 26)
			 (char->integer #\A))))
	  (cons (integer->char shift) (aux (+ i 1) (cdr s))))))
  (list->string (aux 1 (string->list s))))

(let* ((s (read-line)))
  (print (solve s)))
0