# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
537595 | tqbfjotld | Security Gate (JOI18_security_gate) | C++14 | 5049 ms | 300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
bool checkbr(vector<bool> s){
int t = 0;
for (int x = 0; x<s.size(); x++){
if (s[x]) t++;
else t--;
if (t<0) return false;
}
return t==0;
}
bool valid(string s){
//printf("checking %s\n",s.c_str());
vector<int> pref;
for (int x = 0; x<s.size(); x++){
if (s[x]=='(')
pref.push_back(1);
else pref.push_back(-1);
if (pref.size()>1){
pref.back() = (*----pref.end()) + pref.back();
}
}
int cc = pref.back();
if (cc&1) return false;
if (cc==0){
vector<bool>tt;
for (int x = 0; x<s.size(); x++){
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |