結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー TlapesiumTlapesium
提出日時 2020-04-01 22:29:45
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,130 bytes
コンパイル時間 3,256 ms
コンパイル使用メモリ 220,344 KB
実行使用メモリ 5,252 KB
最終ジャッジ日時 2023-09-09 19:07:18
合計ジャッジ時間 4,601 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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