| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 537560 | jamezzz | Security Gate (JOI18_security_gate) | C++17 | 5092 ms | 300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define sf scanf
#define pf printf
int n,x,pos[25];
char s[105];
int main(){
sf("%d",&n);
assert(n<=100);
sf(" %s",&s);
for(int i=0;i<n;++i){
if(s[i]=='x'){
pos[x]=i;
++x;
}
}
assert(x<=20);
int ans=0;
for(int i=0;i<(1<<x);++i){
for(int j=0;j<x;++j){
if(i&(1<<j))s[pos[j]]=')';
else s[pos[j]]='(';
}
bool val=false;
for(int i=0;i<n;++i){
for(int j=0;j<n;++j){
int cnt=0;bool pos=true;
for(int k=0;k<n;++k){
int mult=1;
if(i<=k&&k<=j)mult=-1;
if(s[k]=='(')cnt+=mult;
else cnt-=mult;
if(cnt<0){
pos=false;
break;
}
}
if(cnt!=0)pos=false;
if(pos){
val=true;
break;
}
}
if(val)break;
}
if(val)++ans;
}
pf("%d\n",ans);
}
컴파일 시 표준 에러 (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... | ||||
