=== 풀이 === {{{ // // main.cpp // usa_selfish // // Created by 김 태진 on 12. 8. 14.. // Copyright (c) 2012년 __MyCompanyName__. All rights reserved. // #include #include #include using namespace std; typedef struct cow cow; struct cow{ int left; int right; }; int compare(const void* a,const void* b); int comp(cow a,cow b); int main() { int N,i,j,k; cow arr[50000],temp; cow array[10000]; scanf("%d",&N); for(i=0;iarr[j].right){ temp=arr[i]; arr[i]=arr[j]; arr[j]=temp; } } }*/ array[0]=arr[0]; k=1; for(i=0;iright; return *(int*)a-*(int*)b;//*((cow *)a)->right - *((cow *)b)->right; } int comp(cow a,cow b) { //if(a.left == b.left)return a.right b.right){ return a.right > b.right; }else{ return a.right < b.right; } */ } }}} ---- [ACM_ICPC/2012스터디]