結果
問題 | No.18 うーさー暗号 |
ユーザー | yoza |
提出日時 | 2016-12-11 20:56:48 |
言語 | Vim script (v9.1) |
結果 |
AC
|
実行時間 | 14 ms / 5,000 ms |
コード長 | 659 bytes |
コンパイル時間 | 57 ms |
コンパイル使用メモリ | 5,216 KB |
実行使用メモリ | 5,800 KB |
最終ジャッジ日時 | 2023-09-21 12:34:12 |
合計ジャッジ時間 | 1,121 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
5,664 KB |
testcase_01 | AC | 3 ms
5,636 KB |
testcase_02 | AC | 4 ms
5,632 KB |
testcase_03 | AC | 14 ms
5,752 KB |
testcase_04 | AC | 8 ms
5,712 KB |
testcase_05 | AC | 7 ms
5,692 KB |
testcase_06 | AC | 11 ms
5,796 KB |
testcase_07 | AC | 11 ms
5,752 KB |
testcase_08 | AC | 13 ms
5,800 KB |
testcase_09 | AC | 12 ms
5,748 KB |
testcase_10 | AC | 4 ms
5,688 KB |
testcase_11 | AC | 4 ms
5,580 KB |
testcase_12 | AC | 9 ms
5,628 KB |
ソースコード
function! s:output() let this = {'lines': []} function! this.append(line) abort call add(self.lines, a:line) endfunction function! this.build() abort return join(self.lines, "\n") endfunction return this endfunction function! s:main(input) abort let o = s:output() let s = a:input[0] let r = [] let offset = char2nr('A') for i in range(strlen(s)) let ord = char2nr(s[i]) - offset let moved = (26 + ord - i % 26 - 1) % 26 let chr = nr2char(moved + offset) call add(r, chr) endfor call o.append(join(r, '')) return o.build() endfunction let s:input = getline(1, '$') enew put =s:main(s:input) 2,$print