1055 集体照

#include
#include    //醉了。。居然是字母排序的问题。。 
using namespace std;
struct student{
	int h;
	string name;
}st[10010];
bool cmp(student a,student b){
	if(a.h == b.h)	return a.nameb.h; 
}
int main(){
	int n,k;
	cin>>n>>k;
	for(int i = 0;i>st[i].name>>st[i].h;
	}
	sort(st,st+n,cmp);
	int count = 0;								//记录学生序号 
	for(int i = 1;i<=k;i++){ 					//i为排数 
		int m = n/k;	 
		if(i == 1) m += n%k;	 
		int num = m-1;					  		//记录起始编号 
		if(m%2==1) {
			num -= 1;
		}
		while(num=0){
			cout<=0){
			cout<

你可能感兴趣的:(1055 集体照)