# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
31794 | 2017-09-09T04:54:49 Z | top34051 | Burza (COCI16_burza) | C++14 | 0 ms | 2024 KB |
#include<bits/stdc++.h> using namespace std; #define maxn 405 int n,k; int dp[maxn], mx[2]; vector<int> from[maxn]; void upd(int val) { int i; for(i=0;i<2;i++) if(mx[i]<val) swap(mx[i],val); } void dfs(int x,int last) { int i; for(i=0;i<from[x].size();i++) if(from[x][i]!=last) dfs(from[x][i],x); mx[0] = mx[1] = -1; for(i=0;i<from[x].size();i++) if(from[x][i]!=last) upd(dp[from[x][i]]); for(i=0;i<2;i++) if(mx[i]!=-1) dp[x] = mx[i] + 1; } main() { int i,x,y; scanf("%d%d",&n,&k); for(i=0;i<n-1;i++) { scanf("%d%d",&x,&y); from[x].push_back(y); from[y].push_back(x); } dfs(1,0); printf("NE"); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Incorrect | 0 ms | 2024 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |