# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1020138 | bachhoangxuan | Security Gate (JOI18_security_gate) | C++17 | 1184 ms | 227668 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int mod=1e9+7;
const int maxn = 305;
int n,ans;
char s[maxn];
int f[maxn][maxn][maxn],g[maxn][2*maxn][3];
int F[maxn][maxn];
bool ok(int i,int x){
if(s[i]=='(' && x==-1) return false;
if(s[i]==')' && x==1) return false;
return true;
};
void dp1(){
F[0][0]=1;
for(int i=1;i<=n;i++){
for(int j=0;j<i;j++) for(int x:{-1,1}){
if(!ok(i,x)) continue;
int nj=j+x;
if(nj>=0) F[i][nj]=(F[i][nj]+F[i-1][j])%mod;
}
}
ans=(ans+F[n][0])%mod;
//cout << ans << '\n';
}
void dp2(){
# | 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... |