# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
103662 | Shtef | Paprike (COI18_paprike) | C++14 | 107 ms | 20484 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
ll n, k, h[100005], kolko[100005];
vector <int> ms[100005];
bool cmp(ll x, ll y){
return x > y;
}
ll dfs(int x, int p){
vector <int> v;
kolko[x] = 1;
for(vector <int>::iterator i = ms[x].begin() ; i != ms[x].end() ; ++i){
int o = *i;
if(o == p)
continue;
v.push_back(dfs(o, x));
kolko[x] += kolko[o];
}
sort(v.begin(), v.end(), cmp);
//cout << x << ":" << kolko[x] << endl;
if(!v.empty() && v[0] >= h[x]){
v[0] -= h[x];
kolko[x]--;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |