Submission #722878

# Submission time Handle Problem Language Result Execution time Memory
722878 2023-04-13T04:09:20 Z Mardonbekhazratov Stranded Far From Home (BOI22_island) C++17
0 / 100
1 ms 296 KB
#include<bits/stdc++.h>
using namespace std;
vector<vector<int>>v;
int main(){
	int n,m;cin>>n>>m;
	vector<int>a(n);
	v.resize(n);
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<m;i++){
		int a,b;cin>>a>>b;--a;--b;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	for(int i=0;i<n;i++){
		int s=0;
		bool b=false;
		for(int z:v[i])
			if(a[z]<=a[i]){cout<<1;b=true;break;}
		if(!b) cout<<0;
	}
}

Compilation message

island.cpp: In function 'int main()':
island.cpp:15:7: warning: unused variable 's' [-Wunused-variable]
   15 |   int s=0;
      |       ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -