# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
861865 | iskhakkutbilim | parentrises (BOI18_parentrises) | C++17 | 1064 ms | 262144 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
const int mod = 1e9 + 7;
int P;
int readable(string &s){
int n = s.size();
map<pair<int, int>, bool> dp[n];
if(s[0] == ')' or s[n-1] == '('){
return 0;
}
dp[0][{0, 1}] = 1, dp[0][{1, 0}] = 1;
dp[0][{1, 1}] = 1;
for(int i = 1;i < n; i++){
for(auto [pp, y] : dp[i-1]){
int x1 = pp.ff, x2 = pp.ss;
int ok = 0;
int c = s[i]==')' ? -1 : 1;
if(x2 + c >= 0){
ok++;
dp[i][{x1, x2 + c}] = 1;
}
if(x1 + c >= 0){
ok++;
컴파일 시 표준 에러 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |