結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-08 21:46:55 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 693 bytes |
| コンパイル時間 | 1,795 ms |
| コンパイル使用メモリ | 177,332 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-27 15:15:54 |
| 合計ジャッジ時間 | 2,184 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
/**
@file 018.cpp
@title No.18 うーさー暗号 - yukicoder
@url https://yukicoder.me/problems/no/18
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, N) for (int i = 0; i < (N); ++i)
int main() {
string S;
cin >> S;
map<char, int> m;
vector<char> dict;
int count = 0;
for (char c = 'A'; c <= 'Z'; c++) {
m[c] = count;
count++;
dict.push_back(c);
}
REP(i, (int)S.size()) {
// cout << m[S[i]] << " ";
// cout << (m[S[i]] - i - 1 + 26 * (int)S.size()) % 26 << " ";
cout << dict[(m[S[i]] - i - 1 + 26 * (int)S.size()) % 26];
}
cout << endl;
return 0;
}