이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
const int MAXN = 400;
pii points[MAXN];
int n;
pii operator+(pii a, pii b) {
	return pii(a.first+b.first, a.second+b.second);
}
pii operator-(pii a, pii b) {
	return pii(a.first-b.first, a.second-b.second);
}
int operator*(pii a, pii b) {
	return a.first*b.second-a.second*b.first;
}
pii operator*(int a, pii b) {
	return pii(a*b.first, a*b.second);
}
class action {
public:
	int a, b, c;
	action(int a, int b, int c) : a(a), b(b), c(c) {}
};
vector<action> actions;
void make_action(int a, int b, int c) {
	actions.push_back(action(a, b, c));
	points[c] = points[a]+points[b]-points[c];
}
void reflect(int a, int b, int c) { // reflect triangle about c
	make_action(c, b, a);
	make_action(c, a, b);
	make_action(c, b, a);
}
bool x_good = 0, y_good = 0;
bool good(int x, int y, int z) {
	pii a = 2*points[z]-points[x]-points[y];
	if (a.first*a.second >= 0) {
		if (a.first != 0 && !x_good) {
			if (a.first < 0) {
				make_action(x, y, z);
			}
			x_good = 1;
			return 1;
		}
		if (a.second != 0 && !y_good) {
			if (a.second < 0) {
				make_action(x, y, z);
			}
			y_good = 1;
			return 1;
		}
	}
	return 0;
}
int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> points[i].first >> points[i].second;
	}
	int a = 0, b = 1, c = -1;
	for (int i = 2; i < n; i++) {
		if ((points[i]-points[a])*(points[i]-points[b]) != 0) {
			c = i;
			break;
		}
	}
	if (c == -1) {
		cout << "-1\n";
		return 0;
	}
	for (int i = 0; i < 2; i++) {
		if (good(c, b, a)) {
			swap(a, c);
		}
		else if (good(c, a, b)) {
			swap(b, c);
		}
		for (int j = 0; j < 30; j++) {
			reflect(a, b, c);
			make_action(a, b, c);
		}
	}
	for (int i = 0; i < n; i++) {
		if (i == a || i == b || i == c) continue;
		make_action(a, b, i);
	}
	cout << actions.size() << "\n";
	for (int i = 0; i < actions.size(); i++) {
		action m = actions[i];
		cout << (1+m.a) << " " << (1+m.b) << " " << (1+m.c) << "\n";
	}
}
컴파일 시 표준 에러 (stderr) 메시지
paralelogrami.cpp: In function 'int main()':
paralelogrami.cpp:103:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<action>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  103 |  for (int i = 0; i < actions.size(); i++) {
      |                  ~~^~~~~~~~~~~~~~~~| # | 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... | 
| # | 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... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |