結果

問題 No.18 うーさー暗号
コンテスト
ユーザー dgd1724
提出日時 2016-09-07 18:31:09
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 495 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 664 ms
コンパイル使用メモリ 90,456 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-05-10 21:18:46
合計ジャッジ時間 1,536 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <cstdlib>
#include <cmath>
#include <fstream>

int main(void) {

	//test用
	//std::ifstream in("test.txt");
	//std::cin.rdbuf(in.rdbuf());

	std::string str;
	std::cin >> str;

	for (int i = 0; i < str.length(); i++) {
		int temp = str[i] - (i + 1);
		if (temp >= 65) {
			str[i] = temp;
		}
		else {
			str[i] = 90 - std::abs(65 - temp) % 26 + 1;
		}
	}

	std::cout << str << std::endl;

}
0