| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 244491 | tqbfjotld | Potemkin cycle (CEOI15_indcyc) | C++14 | 1095 ms | 512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int n,e;
bool adjm[15][15];
vector<int> cur;
bool used[15];
bool thing(){
for (int x = 0; x<n; x++){
if (used[x]) continue;
if (cur.size()>0&&!adjm[x][cur[cur.size()-1]])continue;
bool possible = true;
for (int y = 1; 1+y<cur.size(); y++){
if (adjm[x][cur[y]]){
possible = false;
}
}
if (possible){
if (cur.size()>=3&&adjm[x][cur[0]]){
cur.push_back(x);
return true;
}
if (cur.size()>1&&adjm[x][cur[0]]) continue;
cur.push_back(x);
used[x] = true;
if (thing()){
return true;
}
cur.pop_back();
used[x] = false;
}
}
return false;
}
int main(){
scanf("%d%d",&n,&e);
for (int x = 0; x<e; x++){
int a,b;
scanf("%d%d",&a,&b);
a--;b--;
adjm[a][b] = 1;
adjm[b][a] = 1;
}
if (thing()){
for (int x : cur){
printf("%d ",1+x);
}
}
else{
printf("no");
}
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
