結果
問題 | No.18 うーさー暗号 |
ユーザー | siguma323 |
提出日時 | 2016-05-08 15:56:48 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 714 bytes |
コンパイル時間 | 607 ms |
コンパイル使用メモリ | 84,424 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-07 06:08:20 |
合計ジャッジ時間 | 1,017 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
ソースコード
#include <vector> #include <string> #include <algorithm> #include <numeric> #include <iostream> #include <cstdlib> #include <cstring> #include <utility> #include <list> #include <map> #include <queue> #include <iterator> #include <cmath> #include <iomanip> using namespace std; using ull = unsigned long long; using ll = long long; int main() { string s; cin >> s; string data = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for(int i =0; i < s.size(); ++i) { int pos = data.find(s.at(i)); int tmp = (i+1) % 26; if(pos - tmp >= 0) pos -= tmp; else { pos = 26 - (tmp - pos); } cout << data.at(pos); } cout << endl; }