QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#102823#3185. Biking DuckPetroTarnavskyi#Compile Error//C++171.6kb2023-05-03 18:16:142023-05-03 18:16:18

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-05-03 18:16:18]
  • 评测
  • [2023-05-03 18:16:14]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

struct Point {
	int x, y;
	Point() {}
	Point(int _x, int _y): x(_x), y(_y) {}
	Point operator-(const Point& p) const {
		return Point(x - p.x, y - p.y);
	}
	LL operator*(const Point& p) const {
		return x * p.y - p.x * y;
	}
	bool operator<(const Point& p) const {
		return x != p.x ? x < p.x : y < p.y;
	}
};

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	vector<Point> p[2];
	FOR(i, 0, 2) {
		int n;
		cin >> n;
		p[i].resize(n);
		for (Point& pi : p) {
			cin >> pi.x >> pi.y;
		}
	}
	int iMinPoint = 0;
	FOR(i, 0, SZ(p[0])) {
		if (p[0][i] < p[0][iMinPoint]) {
			iMinPoint = i;
		}
	}
	vector<int> convex;
	FOR(i, iMinPoint, iMinPoint + SZ(p[0]) + 1) {
		int j = i % SZ(p[0]);
		while (SZ(convex) > 1 && (p[0][convex.back()] - p[0][SZ(convex) - 2]) * (p[0][j] - p[0][SZ(convex) - 2]) <= 0) {
			convex.pop_back();
		}
		convex.push_back(j);
	}
	assert(convex[0] == iMinPoint && convex.back() == iMinPoint);
	FOR(i, 0, SZ(convex) - 1) {
		vector<Point> points;
		for (int j = convex[i]; j != convex[i + 1]; j = (j + 1) % SZ(p[0])) {
			points.push_back(p[0][j]);
		}
		int s = 0, t = SZ(points) - 1;
		bool inside = false;
		FOR(j, 0, SZ(p[1])) {
			if ()
		}
	}
	return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:41:34: error: invalid initialization of reference of type ‘Point&’ from expression of type ‘std::vector<Point>’
   41 |                 for (Point& pi : p) {
      |                                  ^
answer.code:68:29: error: expected primary-expression before ‘)’ token
   68 |                         if ()
      |                             ^
answer.code:69:17: error: expected primary-expression before ‘}’ token
   69 |                 }
      |                 ^