Submission #1062317

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10623172024-08-17 03:09:44vjudge1Port Facility (JOI17_port_facility)C++17
0 / 100
1 ms348 KiB
#include <stdio.h>
#include<utility>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
const int N=2005;
int n,a[N],b[N];
vector<int>g[N];
int cut(int i, int j){
return (a[i]<a[j] and b[i] > a[j] and b[i]<b[j])
or(a[j]<a[i] and b[j]>a[i] and b[j]<b[i]);
}
int main() {
scanf("%d",&n);
for(int i=0;i<n;++i)scanf("%d%d",a+i,b+i);
for(int i=0;i<n;++i)for(int j=0;j<n;++j)if(cut(i,j)){
g[i].push_back(j);
}
int comp{};
vector<int>col(n),pw2(n);
pw2[0]=1;for(int i=1;i<n;++i)pw2[i]=pw2[i-1]*2%1000000007;
for(int i=0;i<n;++i){
if(col[i])continue;
queue<int>q;
q.push(i);col[i]=1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

port_facility.cpp: In function 'int main()':
port_facility.cpp:18:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |   scanf("%d",&n);
      |   ~~~~~^~~~~~~~~
port_facility.cpp:19:28: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   19 |   for(int i=0;i<n;++i)scanf("%d%d",a+i,b+i);
      |                       ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...