結果

問題 No.3061 uxs hxixtya pyuyn ixc hyixa kxuyn
ユーザー tomatoma
提出日時 2020-04-01 22:19:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 1,834 bytes
コンパイル時間 1,742 ms
コンパイル使用メモリ 178,028 KB
実行使用メモリ 6,548 KB
最終ジャッジ日時 2023-12-20 15:19:47
合計ジャッジ時間 3,289 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tp3 = tuple<int, int, int>;
using Mat = vector<vector<ll>>;
constexpr int INF = 1 << 28;
constexpr ll INFL = 1ll << 60;
constexpr int dh[4] = { 0,1,0,-1 };
constexpr int dw[4] = { -1,0,1,0 };
bool isin(const int H, const int W, const int h, const int w) {
    return 0 <= h && h < H && 0 <= w && w < W;
}
template<typename T>
T minch(T& l, T r) {
    return l = min(l, r);
}
template<typename T>
T maxch(T& l, T r) {
    return l = max(l, r);
}
template<typename T>
void output(const T& val) {
    cout << val << endl;
}
template<typename T>
void output(const vector<T>& vec, const bool newline = false) {
    for (const T& val : vec)cout << val << (newline ? '\n' : ' '); cout << endl;
}
template<typename T>
void output(const vector<vector<T>>& mat) {
    for (const auto& row : mat)output(row);
}
// ============ template finished ============

string erasing(string s, vector<bool> erase) {
    const int N = s.size();
    set<char> st;
    rep(i, N)if (erase[i]) {
        st.insert(s[i]);
        s[i] = ' ';
    }
    for (char& c : s)if (st.find(c) != st.end())c = ' ';
    return s;
}

bool judge(string s) {
    for (char c : s)if (c != ' ')return true;
    return false;
}

int main()
{
    string s;
    getline(cin, s);
    int N = s.size();
    rep(r, N + 1)rep(l, r - 1) {
        vector<bool> erase(N, false);
        rep(i, l)erase[i] = true;
        REP(i, l, r)if ((i - l) % 2 == 1)erase[i] = true;
        REP(i, r, N)erase[i] = true;

        auto parsed = erasing(s, erase);
        if (judge(parsed)) {
            output("Yes");
            return 0;
        }
    }
    output("NO");
    return 0;
}
0