# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979906 | 2024-05-11T15:40:56 Z | vjudge1 | Closing Time (IOI23_closing) | C++17 | 83 ms | 20312 KB |
#include "closing.h" using namespace std; #include <bits/stdc++.h> #define pb push_back using lli=long long; int max_score(int N, int X, int Y, long long K, vector<int> U, vector<int> V, vector<int> W) { vector<vector<pair<int,lli>>> adj (N); for(int i=0; i<N-1; ++i){ adj[U[i]].pb({V[i], W[i]}); adj[V[i]].pb({U[i], W[i]}); } int ans=0; vector<bool> visited (N, false); priority_queue<pair<lli,int>, vector<pair<lli,int>>, greater<pair<lli,int>>> pq; pq.push({0, X}); pq.push({0,Y}); while(!pq.empty()){ lli a=pq.top().first; lli b=pq.top().second; pq.pop(); if(visited[b]) continue; if(K<a) break; ans++; visited[b]=true; K-=a; for(int i=0; i<adj[b].size(); ++i){ if(!visited[adj[b][i].first]){ pq.push({adj[b][i].second+a, adj[b][i].first}); } } } return ans; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 75 ms | 20200 KB | Output is correct |
2 | Correct | 83 ms | 20312 KB | Output is correct |
3 | Correct | 62 ms | 2896 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '30', found: '17' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '30', found: '17' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '30', found: '17' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | 1st lines differ - on the 1st token, expected: '6', found: '5' |
2 | Halted | 0 ms | 0 KB | - |