結果
問題 | No.18 うーさー暗号 |
ユーザー |
|
提出日時 | 2016-02-06 14:57:33 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 446 bytes |
コンパイル時間 | 537 ms |
コンパイル使用メモリ | 19,816 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-08 23:46:08 |
合計ジャッジ時間 | 1,140 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
let length_of_alphabet = 26let first_of_alphabet = int_of_char 'A'let decrypt ind c =let amount = (ind + 1) mod length_of_alphabet inlet c = int_of_char c inlet slided = c - amount inlet slided = if slided < first_of_alphabet then (int_of_char 'Z') - (first_of_alphabet - slided - 1) else slided inchar_of_int slidedlet () =let crypted = read_line () inlet result = String.mapi decrypt crypted inprint_string result