답안 #161729

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
161729 2019-11-04T09:52:16 Z andrew Split the Attractions (IOI19_split) C++17
0 / 100
28 ms 26744 KB
#include <bits/stdc++.h>
#include "split.h"

#define fi first
#define se second
#define pll pair<ll, ll>
#define pii pair<int, int>


using namespace std;
typedef long long ll;
typedef long double ld;
const ll MAXN = 1123456;
const ll N = 2e5;

vector <ll> v[MAXN];

vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) {
    int m = p.size(), mx = 0;

    for(int i = 0; i < m; i++){
        v[p[i]].push_back(q[i]);
        v[q[i]].push_back(p[i]);
        mx = max(mx, (int)v[p[i]].size());
        mx = max(mx, (int)v[q[i]].size());
    }

    vector <int> res(n);

    if(mx < 3){
        int F = 0, Last = 0;
        for(int i = 0; i < n; i++)if(v[i].size() == 1)F = i;
        int step = 1;
        vector <int> cnt(3);
        cnt[0] = a;
        cnt[1] = b;
        cnt[2] = c;
        for(int i = 0; i < n; i++){
            if(i){
                int New = 0;
                for(auto j : v[F])if(j != Last)New = j;
                Last = F;
                F = New;
            }
            while(!cnt[step])step++;
            --cnt[step];
            res[F] = step;
        }
        return res;
    }else if(m == n - 1){
        return res;
    }else{
        return res;
    }
	return res;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 26744 KB answer for 1-th vertex does not belong to {0, 1, 2, 3}
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 27 ms 26744 KB answer for 0-th vertex does not belong to {0, 1, 2, 3}
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 27 ms 26620 KB jury found a solution, contestant did not
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 26616 KB jury found a solution, contestant did not
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 26744 KB answer for 1-th vertex does not belong to {0, 1, 2, 3}
2 Halted 0 ms 0 KB -