結果
| 問題 | No.18 うーさー暗号 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-28 11:55:17 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 5,000 ms |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 666 ms |
| コンパイル使用メモリ | 71,760 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-28 21:05:17 |
| 合計ジャッジ時間 | 1,048 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 13 |
ソースコード
#include <cstdlib>
#include <iostream>
#include <string>
static constexpr int N_ALPHABET = 'z' - 'a' + 1;
int
main()
{
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::string s;
std::cin >> s;
for (std::string::size_type i = 0; i < s.length(); i++) {
s[i] = static_cast<char>('A' + ((s[i] - 'A') + (N_ALPHABET - (i + 1) % N_ALPHABET)) % N_ALPHABET);
}
std::cout << s << std::endl;
return EXIT_SUCCESS;
}