답안 #1080260

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1080260 2024-08-29T08:25:34 Z Sir_Ahmed_Imran 기지국 (IOI20_stations) C++17
5 / 100
628 ms 948 KB
                            ///~~~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();
        l.append(0);
        e[i]=0;
    }
    for(int i=0;i<n-1;i++){
        a[v[i]].append(u[i]);
        a[u[i]].append(v[i]);
        e[v[i]]++;
        e[u[i]]++;
    }
    for(int i=0;i<n;i++){
        if(e[i]>1) continue;
        dfs(i,-1);
        break;
    }
    return(l);
}
int find_next_station(int s,int t,vector<int> c){
    return s-(s>t)+(t>s);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 377 ms 684 KB Output is correct
2 Correct 295 ms 684 KB Output is correct
3 Correct 599 ms 684 KB Output is correct
4 Correct 472 ms 684 KB Output is correct
5 Correct 402 ms 684 KB Output is correct
6 Correct 313 ms 684 KB Output is correct
7 Correct 307 ms 684 KB Output is correct
8 Correct 2 ms 764 KB Output is correct
9 Correct 2 ms 764 KB Output is correct
10 Correct 1 ms 768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 295 ms 684 KB Wrong query response.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 346 ms 684 KB Output is correct
2 Correct 329 ms 684 KB Output is correct
3 Correct 553 ms 684 KB Output is correct
4 Correct 453 ms 936 KB Output is correct
5 Correct 391 ms 852 KB Output is correct
6 Correct 320 ms 684 KB Output is correct
7 Correct 295 ms 684 KB Output is correct
8 Correct 1 ms 768 KB Output is correct
9 Correct 3 ms 760 KB Output is correct
10 Correct 1 ms 772 KB Output is correct
11 Incorrect 382 ms 688 KB Wrong query response.
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 628 ms 684 KB Output is correct
2 Correct 379 ms 684 KB Output is correct
3 Correct 433 ms 684 KB Output is correct
4 Correct 1 ms 764 KB Output is correct
5 Correct 1 ms 764 KB Output is correct
6 Correct 1 ms 948 KB Output is correct
7 Incorrect 448 ms 688 KB Wrong query response.
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 374 ms 684 KB Output is correct
2 Correct 328 ms 684 KB Output is correct
3 Correct 620 ms 684 KB Output is correct
4 Correct 497 ms 688 KB Output is correct
5 Correct 471 ms 684 KB Output is correct
6 Correct 331 ms 684 KB Output is correct
7 Correct 330 ms 684 KB Output is correct
8 Correct 1 ms 776 KB Output is correct
9 Correct 3 ms 776 KB Output is correct
10 Correct 0 ms 768 KB Output is correct
11 Incorrect 335 ms 684 KB Wrong query response.
12 Halted 0 ms 0 KB -