QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#137158#237. Triangle PartitionAkagi_Ritsuko_2190 0ms0kbC++201.1kb2023-08-10 00:30:572023-08-10 00:31:00

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-10 00:31:00]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2023-08-10 00:30:57]
  • 提交

answer

#include<bits/stdc++.h>
#define rep(i, l, r) for(int i = l; i <= r; i++)
#define per(i, r, l) for(int i = r; i >= l; i--)
#define _rep(i, l, r) for(int i = l; i < r; i++)
#define _per(i, r, l) for(int i = r; i > l; i--)
#define pb push_back
#define po pop_back
#define empb emplace_back
#define emp emplace
using namespace std;

using ldb = long double;
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pil = pair<int, ll>;
using vii = vector<pii>;
using vli = vector<pli>;
using vil = vector<pil>;

struct node {
    int x, y, id; 	
};

void solve() {
	int n; cin >> n;
	
	node a[n + 2]; 
	
	rep(i, 1, 3 * n) {
		cin >> a[i].x >> a[i].y;
		a[i].id = i;  
	}
	
	sort(a + 1, a + 1 + 3 * n, [&](const node A, const node B) {
		return A.x < B.x; 
	});
	
	rep(i, 1, n) cout << a[3 * i - 2].id << " " << a[3 * i - 1].id << " " << a[3 * i].id << '\n'; 
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	int T; cin >> T; 
	while (T--) solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Dangerous Syscalls

input:

190
10
-7215 2904
-5179 1663
-542 1091
-5687 7868
7838 -1048
-2944 4346
-2780 3959
-9402 1099
-8548 -7238
-3821 -2917
2713 295
-856 -8661
7651 3945
-8216 -543
5798 5024
8583 -3384
-1208 5955
3068 -385
340 2968
6559 -272
4537 5075
5126 4343
639 8281
1700 2572
819 9317
-9854 -1316
-3421 -1137
9368 718...

output:


result: