結果

問題 No.8061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー Tlapesium
提出日時 2020-04-01 22:29:45
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,130 bytes
コンパイル時間 13,935 ms
コンパイル使用メモリ 277,292 KB
最終ジャッジ日時 2025-01-09 12:14:03
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 16 WA * 1 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target ("avx")
#define io_init cin.tie(0);ios::sync_with_stdio(0);cout<<setprecision(10)
#include <bits/stdc++.h>
constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

//abcde
int main() {
	//io_init;
	string S;
	getline(cin, S);
	if (S.size() == 1) {
		cout << "NO" << endl;
		return 0;
	}
	else if (S.size() == 2) {
		if (S[0] == S[1]) {
			cout << "NO" << endl;
		}
		else {
			cout << "Yes" << endl;
		}
		return 0;
	}
	bool flag = false;
	for (int i = 0; i <= S.size() - 1; i++) {
		string tmp = S.substr(i, 2);
		if (tmp[0] == ' ')continue;
		set<char> used;
		for (int j = 0; j < i; j++)if (S[j] != ' ')used.insert(S[j]);
		for (int j = i + 2; j < S.size(); j++)if (S[j] != ' ')used.insert(S[j]);
		if (!used.count(tmp[0]) && !used.count(tmp[0]))flag = true;
	}
	
	if (flag) {
		cout << "Yes" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	return 0;
}
0