# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
674529 | esomer | Homework (CEOI22_homework) | C++17 | 449 ms | 280132 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;
#define ll long long
#define endl "\n"
const int MOD = 998244353;
const int maxN = 3000000;
int N;
set<int> closing[maxN];
string s;
pair<int, int> calc(int l, int r, int depth){
if(l == r){return {1, 1};}
int coma;
if(s[l + 4] == '?') coma = l + 5;
else{
coma = *closing[depth + 2].lower_bound(l); coma++;
}
pair<int, int> f = calc(l + 4, coma - 1, depth + 1);
pair<int, int> st = calc(coma + 1, r - 1, depth + 1);
if(s[l + 1] == 'i'){
return {f.first + st.first, min(f.second, st.second)};
}else{
return {min(f.first, st.first), f.second + st.second};
}
}
# | 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... |