답안 #113095

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
113095 2019-05-23T15:41:56 Z Markomafko972 Plahte (COCI17_plahte) C++14
0 / 160
947 ms 32812 KB
#include <bits/stdc++.h>
#define X first
#define Y second
typedef long long ll;
using namespace std;

const int MOD = 1e9 + 7;
const ll INF = 1e18;

int n, m;
int a[80002];
int b[80002];
int c[80002];
int d[80002];
map< int, vector< pair<int, int> > > mp;
map< int, vector< pair<int, int> > > :: iterator it;
vector< pair<int, int> > tren;
vector<int> v[80002];
set< pair< pair<int, int>, int> > s;
set< pair< pair<int, int>, int> > :: iterator it2;
bitset<80002> p[80002];
int p1[80002];
int p2[80002];
int p3[80002];

int main () {

	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> m;
	for (int i = 0; i < n; i ++) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
		mp[a[i]].push_back({i, 0});
		mp[c[i]].push_back({i, 1});
	}
	
	for (it = mp.begin(); it != mp.end(); it ++) {
		tren = it -> second;
		for (int i = 0; i < tren.size(); i ++) {
			int w = tren[i].X;
			int f = tren[i].Y;
			
			if (f == 0) {
				it2 = s.lower_bound({{b[w], 0}, 0});
				if (it2 != s.end()) {
					v[(it2 -> second)].push_back(w);
				}
				
				s.insert({{d[w], b[w]}, w});
			}
			else {
				s.erase({{d[w], b[w]}, w});
			}
		}
	}
	
	/*for (int i = 0; i < n; i ++) {
		cout << i << ": ";
		for (int j = 0; j < v[i].size(); j ++) cout << v[i][j] << " ";
		cout << endl;
	}*/
	
	for (int i = 0; i < m; i ++) {
		cin >> p1[i] >> p2[i] >> p3[i];
	}
	
	for (int i = 0; i < n; i ++) {
		cout << p[i].count() << endl;
	}

	return 0;
}

Compilation message

plahte.cpp: In function 'int main()':
plahte.cpp:39:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for (int i = 0; i < tren.size(); i ++) {
                   ~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 204 ms 9720 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 310 ms 13816 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 526 ms 21672 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 877 ms 32812 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 947 ms 32692 KB Output isn't correct
2 Halted 0 ms 0 KB -