結果

問題 No.18 うーさー暗号
ユーザー DadarithmDadarithm
提出日時 2015-09-13 23:19:14
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 355 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 52,584 KB
実行使用メモリ 7,588 KB
最終ジャッジ日時 2023-09-26 11:47:21
合計ジャッジ時間 7,091 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
7,508 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;

char conv(char c, int i)
{
	const char a = 65, z = 90;

	if (c - i < a)
		return conv(c + (z - a + 1), i);
	else
		return c - i;
}

int main()
{
	string res;
	cin >> res;

	string ans = "";
	for (int p = 1; p <= res.size(); ++p)
		ans += conv(res[p - 1], p);

	cout << ans << endl;

	return 0;
}
0