Submission #723025

# Submission time Handle Problem Language Result Execution time Memory
723025 2023-04-13T07:36:26 Z Erkinoff_Mohammed Stranded Far From Home (BOI22_island) C++14
Compilation error
0 ms 0 KB
#include "bits/stdc++.h"
#include "communication.h"
using namespace std;
#define INF 2000000000
#define INFLL 3000000000000000000LL
#define ll long long





int main() {
    cin.tie(0)->sync_with_stdio(0);
    int n,m;
    cin>>n>>m;
    if(n<=2000&&m<=2000){
        
        long long siz[n+1];
        for(int i=1;i<=n;i++)cin>>siz[i];
        
        vector<int>adj[n+1];
        for(int i=0;i<m;i++){
            int a,b;
            cin>>a>>b;
            adj[a].push_back(b);
            adj[b].push_back(a);
        }
        
        for(int i=1;i<=n;i++){
            bool vis[n+1];
            for(int i=0;i<=n;i++)vis[i]=0;
            priority_queue<pair<int,int>>q;
            long long cur=siz[i];
            bool b=1;
            q.push({0,i});
            while(!q.empty()){
                auto u=q.top();q.pop();
                int j=u.second;
                int si=-u.first;
                if(si>cur){
                    b=0;
                    break;
                }
                vis[j]=1;
                cur+=si;
                for(int v:adj[j]){
                    if(!vis[v])q.push({-siz[v],v});
                }
            }
            cout<<b;
        }
    }
}

Compilation message

island.cpp:2:10: fatal error: communication.h: No such file or directory
    2 | #include "communication.h"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.