답안 #372958

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
372958 2021-03-02T13:37:36 Z Jarif_Rahman 기지국 (IOI20_stations) C++17
0 / 100
1 ms 620 KB
#include "stations.h"
#include <bits/stdc++.h>
#define pb push_back
#define f first
#define sc second
using namespace std;
typedef long long int ll;
typedef string str;
vector<vector<int>> v;
vector<int> order;
void dfs(int nd, int ss){
    order.pb(nd);
    for(int x: v[nd]) if(x != ss) dfs(x, nd);
}
vector<int> label(int n, int k, vector<int> aa, vector<int> bb){
    v.assign(n, {});
    order.clear();
    for(int i = 0; i < n-1; i++){
        v[aa[i]].pb(bb[i]);
        v[bb[i]].pb(aa[i]);
    }
    for(int i = 0; i < n; i++){
        if(v[i].size() == 1) (i, -1);
        break;
    }
    vector<int> lb(n);
    for(int i = 0; i < n; i++) lb[order[i]] = i;
    return lb;
}
int find_next_station(int s, int t, vector<int> c){
    if(s < t) return s+1;
    return s-1;
}

Compilation message

stations.cpp: In function 'std::vector<int> label(int, int, std::vector<int>, std::vector<int>)':
stations.cpp:23:31: warning: left operand of comma operator has no effect [-Wunused-value]
   23 |         if(v[i].size() == 1) (i, -1);
      |                               ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 620 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 500 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -