QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#795757#7894. Many Many Headsimwinter#WA 0ms3560kbC++201.8kb2024-12-01 00:10:342024-12-01 00:10:34

Judging History

你现在查看的是最新测评结果

  • [2024-12-01 00:10:34]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3560kb
  • [2024-12-01 00:10:34]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<set>
#include<vector>
#include<cmath>
#include<cstring>
#include<unordered_map>
#include<queue>
#include<map>
#include<stack>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> PII;

const int N = 1e5 + 10, MOD = 998244353, INF = 1e9 + 10, M = 11;
const double expp = 1e-6;

map<char, int>mp;
int n;

//bool check(string s) {
//    stack<char> st;
//    int cnt1 = 0, cnt2 = 0;
//    for (int i = 1; i <= n - 1; i++) {
//        if (mp[s[i]] == mp[s[i + 1]])cnt1++;
//    }
//    if (cnt1 > 2)return true;
//    return false;
//}
//
////([()])([()])([()])
////

void solve() {
    string s;
    cin >> s;
    //stack<pair<char, int>> st;
    //n = s.size();
    //mp['('] = 0; mp[')'] = 0;
    //mp['['] = 1; mp[']'] = 1;
    //s = " " + s;
    //for (int i = 1; i <= n; i++) {
    //    if (!st.empty()&& mp[s[i]] == mp[st.top().first]) {
    //        char c = st.top().first;
    //        //cout << "This is ceshi\n";
    //        if (s[i] == c) {
    //            if (s[i] == ')')s[st.top().second] = '('; 
    //            else if (s[i] == '(') {
    //                s[i] = ')';
    //            }
    //            else if (s[i] == ']')s[st.top().second] = '[';
    //            else if (s[i] == '[')s[i] = ']'; 
    //        }
    //        st.pop();
    //    }
    //    else st.push({ s[i],i });
    //}
    ////cout << s << '\n';
    //if (check(s))cout << "Yes";
    int cnt = 0;
    for (int i = 1; i < n; i++) {
        if (s[i] == s[i + 1])cnt++;
    }
    if (cnt > 2)cout << "Yes\n";
    else cout << "No\n";
}

int main() {

    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout.tie(0);

    int t = 1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3560kb

input:

6
))
((()
[()]
()[()]()
([()])
([])([])

output:

No
No
No
No
No
No

result:

wrong answer expected YES, found NO [1st token]