Submission #3928

# Submission time Handle Problem Language Result Execution time Memory
3928 2013-08-31T09:24:45 Z shinhj88 Divide into triangle (kriii1_D) C++
1 / 1
0 ms 1236 KB
#include<stdio.h>
#include<stdlib.h>
#include <algorithm>
#include <vector>
using namespace std;
typedef struct M_str{
	int x, y, idx;
};
vector<M_str> m_str;
int n;
int cmp(const M_str &a,const M_str &b)
{
	if(a.x==b.x)return a.y>b.y;
	return a.y>b.y;
}
int main(){
	int i, j;
	scanf("%d", &n);
	m_str.resize(n*3);
	for(i=0;i<n*3;++i){
		scanf("%d%d", &m_str[i].x, &m_str[i].y);
		m_str[i].idx=i+1;
	}
	sort(m_str.begin(),m_str.end(),cmp);
	for(i=0;i<n;++i){
		for(j=0;j<2;++j){
			printf("%d ", m_str[i*3+j].idx);
		}
		printf("%d\n", m_str[i*3+j].idx);
	}

}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1236 KB Output is correct
2 Correct 0 ms 1236 KB Output is correct
3 Correct 0 ms 1236 KB Output is correct
4 Correct 0 ms 1236 KB Output is correct
5 Correct 0 ms 1236 KB Output is correct
6 Correct 0 ms 1236 KB Output is correct
7 Correct 0 ms 1236 KB Output is correct
8 Correct 0 ms 1236 KB Output is correct
9 Correct 0 ms 1236 KB Output is correct
10 Correct 0 ms 1236 KB Output is correct
11 Correct 0 ms 1236 KB Output is correct
12 Correct 0 ms 1236 KB Output is correct
13 Correct 0 ms 1236 KB Output is correct
14 Correct 0 ms 1236 KB Output is correct
15 Correct 0 ms 1236 KB Output is correct
16 Correct 0 ms 1236 KB Output is correct
17 Correct 0 ms 1236 KB Output is correct
18 Correct 0 ms 1236 KB Output is correct
19 Correct 0 ms 1236 KB Output is correct
20 Correct 0 ms 1236 KB Output is correct