# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1069517 | 2024-08-22T04:47:32 Z | Faisal_Saqib | 봉쇄 시간 (IOI23_closing) | C++17 | 60 ms | 21844 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #define pll pair<ll,ll> #define vpl vector<pll> const int N=2e5+10; vpl ma[N]; ll paid[N]; bool vis[N]; int max_score(int n, int x, int y, long long k, std::vector<int> U,std::vector<int> V, std::vector<int> W) { for(int i=0;i<=n;i++) { ma[i].clear(); paid[i]=0; } int m=U.size(); for(int i=0;i<m;i++) { ma[U[i]].push_back({W[i],V[i]}); ma[V[i]].push_back({W[i],U[i]}); } int mx=0; { for(int i=0;i<=n;i++)vis[i]=0; priority_queue<pll,vpl,greater<pll>> pq; pq.push({0,x}); ll cur=0; ll tlp=0; int total=0; while(pq.size()>0) { pll it=pq.top(); pq.pop(); int u=it.second; ll c=it.first; if((cur+c)>k) break; vis[u]=1; cur+=c; paid[u]+=c; total++; for(auto [w,v]:ma[u]) { if(!vis[v]) { pq.push({c+w,v}); vis[v]=1; } } } mx=max(mx,total); } { for(int i=0;i<=n;i++)vis[i]=0; priority_queue<pll,vpl,greater<pll>> pq; pq.push({0,y}); ll cur=0; ll tlp=0; int total=0; while(pq.size()>0) { pll it=pq.top(); pq.pop(); int u=it.second; ll c=it.first; if((cur+c)>k) break; vis[u]=1; cur+=c; paid[u]+=c; total++; for(auto [w,v]:ma[u]) { if(!vis[v]) { pq.push({c+w,v}); vis[v]=1; } } } mx=max(mx,total); } return mx; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 6492 KB | 1st lines differ - on the 1st token, expected: '6', found: '3' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 60 ms | 21844 KB | 1st lines differ - on the 1st token, expected: '451', found: '319' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 6488 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 6488 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 6488 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 6492 KB | 1st lines differ - on the 1st token, expected: '6', found: '3' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 6492 KB | 1st lines differ - on the 1st token, expected: '6', found: '3' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 6492 KB | 1st lines differ - on the 1st token, expected: '6', found: '3' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 6492 KB | 1st lines differ - on the 1st token, expected: '6', found: '3' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 6492 KB | 1st lines differ - on the 1st token, expected: '6', found: '3' |
2 | Halted | 0 ms | 0 KB | - |