| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1119878 | PagodePaiva | 경찰관과 강도 (BOI14_coprobber) | C++17 | 1 ms | 336 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "coprobber.h"
using namespace std;
const int MAXN = 510;
vector <int> g[MAXN];
int pai[MAXN];
int h[MAXN];
vector <pair <int, int>> backedges;
void dfs(int v, int p){
pai[v] = p;
for(auto x : g[v]){
if(x == p) continue;
if(pai[v] != -1){
backedges.push_back({v, x});
continue;
}
h[x] = h[v]+1;
dfs(x, v);
}
return;
}
int start(int n, bool a[MAX_N][MAX_N]){
for(int i = 0;i < n;i++){
for(int j = 0;j < n;j++){
if(a[i][j])
g[i].push_back(j);
}
}
dfs(1, 1);
int tam = 0;
for(auto [a, b] : backedges){
if(h[a] > h[b]) swap(a, b);
tam = max(tam, h[b]-h[a]+1);
}
return (tam >= 5 ? -1 : 0);
}
int nextMove(int R){
//exit(0);
return 0;
}| # | 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... | ||||
