# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
294961 | 2020-09-09T11:09:34 Z | Ruba_K | Split the Attractions (IOI19_split) | C++14 | 118 ms | 13816 KB |
#include "split.h" #include<bits/stdc++.h> using namespace std; const int N = 1e5 + 5 ; vector<int>adj[N]; vector<int> res ; map<int , int > foreach; int vis[N] , degree[N]; int arr[5]; void dfs(int u , int id , int sz ){ if(sz == arr[id])id++ , sz = 0 ; vis[u] ++ ; res[u] = id ; for(auto f : adj[u]){ if(vis[f]) continue ; dfs(f , id , sz + 1); } } vector<int> find_split(int n, int a, int b, int c, vector<int> p, vector<int> q) { res.resize(n); arr[1] = a , arr[2] = b , arr[3] = c ; int m = p.size(); for(int i = 0 ; i < m ; i ++){ adj[p[i]].push_back(q[i]); adj[q[i]].push_back(p[i]); degree[p[i]]++ , degree[q[i]]++; } int mn = 3 , start ; for(int i = 0 ; i < m ; i ++){ if(degree[i] < mn) mn = degree[i] , start = i ; } dfs(start , 1 , 0); return res; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2688 KB | ok, correct split |
2 | Correct | 2 ms | 2688 KB | ok, correct split |
3 | Correct | 2 ms | 2688 KB | ok, correct split |
4 | Correct | 2 ms | 2688 KB | ok, correct split |
5 | Correct | 2 ms | 2688 KB | ok, correct split |
6 | Correct | 2 ms | 2688 KB | ok, correct split |
7 | Correct | 100 ms | 13776 KB | ok, correct split |
8 | Correct | 97 ms | 13816 KB | ok, correct split |
9 | Correct | 105 ms | 13816 KB | ok, correct split |
10 | Correct | 118 ms | 13776 KB | ok, correct split |
11 | Correct | 100 ms | 13816 KB | ok, correct split |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 2720 KB | ok, correct split |
2 | Correct | 2 ms | 2688 KB | ok, correct split |
3 | Incorrect | 2 ms | 2688 KB | jury found a solution, contestant did not |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | invalid split: #1=2, #2=2, #3=1 |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | jury found a solution, contestant did not |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 2688 KB | ok, correct split |
2 | Correct | 2 ms | 2688 KB | ok, correct split |
3 | Correct | 2 ms | 2688 KB | ok, correct split |
4 | Correct | 2 ms | 2688 KB | ok, correct split |
5 | Correct | 2 ms | 2688 KB | ok, correct split |
6 | Correct | 2 ms | 2688 KB | ok, correct split |
7 | Correct | 100 ms | 13776 KB | ok, correct split |
8 | Correct | 97 ms | 13816 KB | ok, correct split |
9 | Correct | 105 ms | 13816 KB | ok, correct split |
10 | Correct | 118 ms | 13776 KB | ok, correct split |
11 | Correct | 100 ms | 13816 KB | ok, correct split |
12 | Correct | 3 ms | 2720 KB | ok, correct split |
13 | Correct | 2 ms | 2688 KB | ok, correct split |
14 | Incorrect | 2 ms | 2688 KB | jury found a solution, contestant did not |
15 | Halted | 0 ms | 0 KB | - |