結果

問題 No.908 うしたぷにきあくん文字列
ユーザー d_seid_sei
提出日時 2019-10-20 19:57:43
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,076 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 83,164 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-15 14:42:43
合計ジャッジ時間 1,583 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<iostream>
#include<algorithm>
#include <vector>
#include<cmath>
#include<iomanip>
#include<queue>
using namespace std;
typedef long long int lint;
/*vector<char>al(26);
al = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };*/
/*vector<char>AL(26);
AL = { 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z' };*/
int main() {
	vector<char>al(26);
	al = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };

	int cnt = 0;
	string S;
	cin >> S;
	int Z = S.size();
	if (Z % 2 == 0) {
		cout << "No" << endl;
	}
	else {
		for (int ia = 0; ia <= (Z - 1) / 2-1; ia++) {
			for (int ib = 0; ib < 26; ib++) {
				if (S.at(ia * 2) == al.at(ib)) {
					cnt++;
				}
			}
			if (S.at(ia * 2 + 1) == ' ') {
				cnt++;
			}
		}
		for (int ic = 0; ic < 26; ic++) {
			if (S.at(Z - 1) == al.at(ic)) {
				cnt++;
			}
		}
		if (cnt == Z) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
}




0