# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
654403 | atigun | Stranded Far From Home (BOI22_island) | C++14 | 414 ms | 724 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 ll;
const int maxn = 2e3;
int n, m;
vector<ll> a(maxn+5);
vector<vector<int>> g(maxn+5);
vector<bool> vis(maxn+5, 0);
bool test(int V){
for(int i = 0; i < maxn+5; i++)
vis[i] = 0;
priority_queue<array<ll, 2>, vector<array<ll, 2>>, greater<array<ll, 2>>> PQ;
int took = 0;
ll curr_size = 0;
PQ.push({0, V});
while(!PQ.empty()){
int v = PQ.top()[1];
PQ.pop();
if(vis[v])
continue;
vis[v] = 1;
if(V!=v && a[v] > curr_size){
return 0;
}
took++;
curr_size+= a[v];
# | 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... |