結果
| 問題 | No.18 うーさー暗号 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2016-02-28 11:55:17 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 5,000 ms | 
| コード長 | 436 bytes | 
| コンパイル時間 | 375 ms | 
| コンパイル使用メモリ | 56,396 KB | 
| 実行使用メモリ | 6,944 KB | 
| 最終ジャッジ日時 | 2024-07-07 06:00:54 | 
| 合計ジャッジ時間 | 880 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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;
}
            
            
            
        