結果

問題 No.163 cAPSlOCK
ユーザー d_seid_sei
提出日時 2019-08-27 14:50:30
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 877 bytes
コンパイル時間 754 ms
コンパイル使用メモリ 81,992 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 15:22:37
合計ジャッジ時間 1,588 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 2 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,940 KB
testcase_16 AC 2 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 2 ms
6,940 KB
testcase_21 AC 2 ms
6,940 KB
testcase_22 AC 2 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
using namespace std;
typedef long long int lont;
int main() {
	string S;
	cin >> S;
	int Z = S.size();
	vector<char>vecA(26);
	vector<char>veca(26);
	vecA = { 'Q','W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'L', 'K', 'J', 'H', 'G', 'F', 'D', 'S', 'A', 'Z', 'X', 'C', 'V', 'B', 'N', 'M' };
	veca = { 'q','w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'l', 'k', 'j', 'h', 'g', 'f', 'd', 's', 'a', 'z', 'x', 'c', 'v', 'b', 'n', 'm' };
	vector<char>vecb(Z);
	for (int ia = 0; ia < Z; ia++) {
		for (int ib = 0; ib < 26; ib++) {
			if (S.at(ia) == vecA.at(ib)) {
				vecb.at(ia) = veca.at(ib);
			}
		}
		for (int ic = 0; ic < 26; ic++) {
			if (S.at(ia) == veca.at(ic)) {
				vecb.at(ia) = vecA.at(ic);
			}
		}
	}
	for (int id = 0; id < Z; id++) {
		cout << vecb.at(id);
	}
	cout << endl;
}
0