///~~~LOTA~~~///
//#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define append push_back
#define add insert
#define nl '\n'
#define ff first
#define ss second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define L0TA ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define terminator main
#define N 1000
int m;
int e[N];
vector<int> l;
vector<int> a[N];
void dfs(int v,int u){
l[v]=m;
m++;
for(auto& i:a[v])
if(i!=u) dfs(i,v);
}
vector<int> label(int n,int k,vector<int> u,vector<int> v){
l.clear();
for(int i=m=0;i<n;i++){
a[i].clear();
e[i]=0;
}
for(int i=0;i<n;i++){
a[v[i]].append(u[i]);
a[u[i]].append(v[i]);
l.append(i);
e[v[i]]++;
e[u[i]]++;
}
for(int i=0;i<n;i++){
if(e[i]>1) continue;
dfs(i,-1);
}
return(l);
}
int find_next_station(int s,int t,vector<int> c){
return s-(s>t)+(t>s);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1853 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
6 ms |
600 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2340 ms |
2097152 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
628 ms |
684 KB |
Output is correct |
2 |
Incorrect |
463 ms |
684 KB |
Wrong query response. |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
856 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |