# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1000904 | 2024-06-18T11:03:28 Z | 변재우(#10901) | 봉쇄 시간 (IOI23_closing) | C++17 | 85 ms | 29876 KB |
#include "closing.h" #include <bits/stdc++.h> using namespace std; using ll=long long; const int Nmax=200010; vector<pair<int, ll>> adj[Nmax]; vector<ll> P; void DFS(int curr, int prev, ll dist) { P.push_back(dist); for(auto [next, w]:adj[curr]) if(next!=prev) DFS(next, curr, dist+w); } int max_score(int N, int X, int Y, ll K, vector<int> U, vector<int> V, vector<int> W) { int ans=0, sum=0; X++, Y++; for(int i=1; i<=N; i++) adj[i].clear(); P.clear(); for(int i=0; i<N-1; i++) adj[U[i]+1].push_back({V[i]+1, W[i]}), adj[V[i]+1].push_back({U[i]+1, W[i]}); DFS(X, 0, 0), DFS(Y, 0, 0); sort(P.begin(), P.end()); for(int i=0; i<P.size(); i++) if(sum+P[i]<=K) ans++, sum+=P[i]; return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 85 ms | 29876 KB | 1st lines differ - on the 1st token, expected: '451', found: '74937' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4956 KB | Output is correct |
2 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '30', found: '24' |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4956 KB | Output is correct |
2 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '30', found: '24' |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 4956 KB | Output is correct |
2 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '30', found: '24' |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 4956 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |