이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define int long long 
using namespace std;
int mod = 1e9 + 7;
pair <int, int> asd[1000001];
int a[1000001];
int b[1000001];
vector <int> g[1000001];
int kol[1000001];
int cnt[1000001];
int col[1000001];
int u[1000001];
int ans = 1, id;
bool check (int i, int j) {
	if (i == j) return 0;
	int l1 = a[i], r1 = b[i];
	int l2 = a[j], r2 = b[j];
	if (r1 < l2 || r2 < l1) return 0;
	if (l1 > l2 && r1 < r2) return 0;
	if (l2 > l1 && r2 < r1) return 0;
	return 1;
}
void dfs (int v, int lvl) {
	u[v] = lvl;     
	for (auto to : g[v]) {
		if (u[to] == u[v]) {
			cout << 0;
			exit (0);
		}
		if (!u[to]) {
			dfs (to, 3 - lvl);
		}
	}
}
 main () {
 	int n;
 	cin >> n;
	for (int i = 1;i <= n;i ++) {
		cin >> asd[i].first >> asd[i].second;
	}
	sort (asd + 1, asd + n + 1);
	for (int i = 1;i <= n;i ++) {
		a[i] = asd[i].first;
		b[i] = asd[i].second;
	}
//	cout << endl;
	for (int i = 1;i <= n;i ++) {
		for (int j = 1;j <= n;j ++) {
			if (check (i, j)) {
				g[i].push_back (j);
//				cout << i << ' ' << j << endl;
			}
		}
	}
	for (int i = 1;i <= n;i ++) {
		if (!u[i]) {
			id ++;
			dfs (i, 1);
			ans = (ans + ans) % mod;
		}
	}       
	cout << ans;
	return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
port_facility.cpp:41:8: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  main () {
        ^| # | 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... |