QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#136627 | #237. Triangle Partition | Rd_rainydays# | 0 | 5ms | 7948kb | C++20 | 465b | 2023-08-09 09:28:38 | 2023-08-09 09:28:39 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
static const int M=1000003;
int T,n;
int X[M],Y[M],P[M];
bool Cmp(int a,int b){
return X[a]==X[b]?Y[a]<Y[b]:X[a]<X[b];
}
int main(){
scanf("%d",&T);
while(T--){
scanf("%d",&n);
for(int i=0;i<3*n;++i)
scanf("%d%d",&X[i],&Y[i]),P[i]=i;
sort(P,P+n,Cmp);
for(int i=0;i<3*n;++i){
printf("%d %d %d\n",P[i]+1,P[i+1]+1,P[i+2]+1);
i+=2;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 5ms
memory: 7948kb
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:
8 9 1 4 2 10 6 7 3 5 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3 5 10 9 7 6 8 2 4 1 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 6 8 10 9 2 1 4 5 7 3 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 8 7 3 1 5 9 6 10 2 4 11 12 13 14 15 16 17 18 19 20 21 22 ...
result:
wrong answer inside