結果
問題 | No.18 うーさー暗号 |
ユーザー |
![]() |
提出日時 | 2015-09-13 23:30:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 362 bytes |
コンパイル時間 | 432 ms |
コンパイル使用メモリ | 56,024 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-07 05:48:23 |
合計ジャッジ時間 | 808 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#include <iostream>#include <string>using namespace std;const int a = 65, z = 90;int conv(int c, int i){if (c - i < a)return conv(c + (z - a + 1), i);elsereturn c - i;}int main(){string res;cin >> res;string ans = "";for (int p = 1; p <= res.size(); ++p)ans += (char)conv((int)res[p - 1], p);cout << ans << endl;return 0;}