Submission #63282765


Source Code Expand

// I AM A MUSLIM

#include "bits/stdc++.h"

#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

#define fast_io std::ios::sync_with_stdio(0);std::cin.tie(0)
#define lli long long int
#define flush fflush(stdout)
#define line printf("\n")
#define yn(a, b) printf("%s\n", (a) >= (b) ? "Yes":"No")
#define amodm(a, M) (((a)%M+M)%M)
// #define int lli

using pii = std::pair<int,int>;

const int MOD = 1000000007;
const int mxN = 500100;

signed main() {
    int testCases=1;
    // scanf("%d",&testCases);
    
    for (int TC = 1; TC <= testCases; TC++) {
        std::string s;
        std::cin >> s;
        std::vector<char> st;
        bool ok = 1;
        for (auto &c : s) {
            if (c == ')') {
                if (st.empty()) {
                    ok = 0;
                    break;
                } else if (st.back() != '(') {
                    ok = 0;
                    break;
                } else st.pop_back();
            } else if (c == ']') {
                if (st.empty()) {
                    ok = 0;
                    break;
                } else if (st.back() != '[') {
                    ok = 0;
                    break;
                } else st.pop_back();
            } else if (c == '>') {
                if (st.empty()) {
                    ok = 0;
                    break;
                } else if (st.back() != '<') {
                    ok = 0;
                    break;
                } else st.pop_back();
            } else st.push_back(c);
        }

        if (st.size()) ok = 0;
        yn(ok, 1);
        
    }
    
    return 0;
}

Submission Info

Submission Time
Task D - Colorful Bracket Sequence
User MArhamAA1422
Language C++ 20 (Clang 16.0.6)
Score 400
Code Size 1697 Byte
Status AC
Exec Time 5 ms
Memory 3764 KiB

Compile Error

./Main.cpp:5:13: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma GCC optimize("O3,unroll-loops")
            ^
./Main.cpp:6:13: warning: unknown pragma ignored [-Wunknown-pragmas]
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
            ^
./Main.cpp:18:11: warning: unused variable 'MOD' [-Wunused-const-variable]
const int MOD = 1000000007;
          ^
./Main.cpp:19:11: warning: unused variable 'mxN' [-Wunused-const-variable]
const int mxN = 500100;
          ^
4 warnings generated.

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 40
Set Name Test Cases
Sample example_00.txt, example_01.txt, example_02.txt
All example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt
Case Name Status Exec Time Memory
example_00.txt AC 1 ms 3636 KiB
example_01.txt AC 1 ms 3484 KiB
example_02.txt AC 1 ms 3500 KiB
hand_00.txt AC 4 ms 3612 KiB
hand_01.txt AC 4 ms 3596 KiB
hand_02.txt AC 4 ms 3704 KiB
hand_03.txt AC 1 ms 3520 KiB
hand_04.txt AC 4 ms 3672 KiB
hand_05.txt AC 1 ms 3564 KiB
hand_06.txt AC 1 ms 3464 KiB
random_00.txt AC 3 ms 3616 KiB
random_01.txt AC 4 ms 3624 KiB
random_02.txt AC 4 ms 3644 KiB
random_03.txt AC 4 ms 3636 KiB
random_04.txt AC 3 ms 3592 KiB
random_05.txt AC 4 ms 3648 KiB
random_06.txt AC 3 ms 3576 KiB
random_07.txt AC 4 ms 3500 KiB
random_08.txt AC 3 ms 3640 KiB
random_09.txt AC 4 ms 3624 KiB
random_10.txt AC 4 ms 3624 KiB
random_11.txt AC 4 ms 3624 KiB
random_12.txt AC 4 ms 3764 KiB
random_13.txt AC 4 ms 3564 KiB
random_14.txt AC 4 ms 3652 KiB
random_15.txt AC 4 ms 3564 KiB
random_16.txt AC 4 ms 3596 KiB
random_17.txt AC 4 ms 3600 KiB
random_18.txt AC 5 ms 3648 KiB
random_19.txt AC 3 ms 3576 KiB
random_20.txt AC 5 ms 3612 KiB
random_21.txt AC 4 ms 3600 KiB
random_22.txt AC 4 ms 3504 KiB
random_23.txt AC 4 ms 3696 KiB
random_24.txt AC 4 ms 3592 KiB
random_25.txt AC 3 ms 3600 KiB
random_26.txt AC 4 ms 3500 KiB
random_27.txt AC 4 ms 3620 KiB
random_28.txt AC 4 ms 3500 KiB
random_29.txt AC 4 ms 3640 KiB