F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_7598184_9086\Main.java:1: ·Ç·¨×Ö·û£º \35
#include <algorithm>#include <cstdlib>#include <iostream>using namespace std; struct act{            int x,y;        }t[555];        int cmp(const void *a, const void *b){        return (*(act*)a).y - (*(act*)b).y;        }        int main(){        int sum,n,low;         while ((cin>>n)&&n!=0){               for(int j=0;j<n;j++)                       cin>>t[j].x>>t[j].y;                              sum=low=0;               qsort(t,n,sizeof(t[0]),cmp);               for(int j=0;j<n;j++)                       if(t[j].x>=low){                               sum++;                               low=t[j].y;                               }                                              cout<<sum<<endl;               }        return 0;        }


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 23:05:12, Gzip enabled