제출 #1263698

#제출 시각아이디문제언어결과실행 시간메모리
1263698aren_dance로봇 (IOI13_robots)C++20
컴파일 에러
0 ms0 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include "robots.h
using namespace std;
int putaway(int a, int b, int t,
	int x[], int y[], int w[], int s[]) {
	int answ = -1;
	int l = 1;
	int r = t;
	vector<pair<int, int>> g;
	for (int i = 0;i < t;++i) {
		g.push_back({ s[i],w[i] });
	}
	sort(g.rbegin(), g.rend());
	while (l <= r) {
		int m = (l + r) / 2;
		multiset<pair<int, int>> p1;
		multiset<pair<int, int>> p2;
		for (int i = 0;i < a;++i) {
			p1.insert({x[i],m});
		}
		for (int i = 0;i < b;++i) {
			p2.insert({y[i],m});
		}
		bool fl = 1;
		for (auto i : g) {
			int x1 = i.second;
			int y1 = i.first;
			auto u = p1.lower_bound(make_pair(x1+1,-1));
			if (u != p1.end()) {
				pair<int, int> o = *u;
				o.second--;
				p1.erase(u);
				if (o.second != 0) {
					p1.insert(o);
				}
				continue;
			}
			auto v = p2.lower_bound(make_pair(y1 + 1, 0));
			if (v != p2.end()) {
				pair<int, int> o = *v;
				o.second--;
				p2.erase(v);
				if (o.second != 0) {
					p2.insert(o);
				}
				continue;
			}
			else {
				fl = 0;
				break;
			}
		}
		if (fl) {
			r = m - 1;
			answ = m;
		}
		else {
			l = m + 1;
		}
	}
	return answ;
}

컴파일 시 표준 에러 (stderr) 메시지

robots.cpp:5:10: warning: missing terminating " character
    5 | #include "robots.h
      |          ^
robots.cpp:5:10: error: #include expects "FILENAME" or <FILENAME>
    5 | #include "robots.h
      |          ^~~~~~~~~