# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
162580 | MvC | Political Development (BOI17_politicaldevelopment) | C++11 | 837 ms | 29932 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef pair<int, int> pi;
vector<int> gph[50005];
set<pi> edgs;
bool vis[50005];
int deg[50005];
int n;
int main(){
scanf("%d %*d",&n);
priority_queue<pi, vector<pi>, greater<pi> > pq;
for(int i=0; i<n; i++){
scanf("%d",°[i]);
gph[i].resize(deg[i]);
pq.push(pi(deg[i], i));
for(auto &j : gph[i]){
scanf("%d",&j);
edgs.insert(pi(i, j));
}
}
int ans = 0;
while(true){
while(!pq.empty() && vis[pq.top().second]) pq.pop();
if(pq.empty()) break;
int w = pq.top().second;
vis[w] = 1;
Compilation message (stderr)
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |