# 今年暑假不AC

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 55315    Accepted Submission(s): 29754

Problem Description
“今年暑假不AC？”
“是的。”
“那你干什么呢？”
“看世界杯呀，笨蛋！”
“@#\$%^&*%...”

Input

Output

Sample Input
12 1 3 3 4 0 7 3 8 15 19 15 20 10 15 8 18 6 12 5 10 4 14 2 9 0

Sample Output
5

Author
lcy

Source

Recommend
lcy   |   We have carefully selected several similar problems for you:  1050 1009 1051 1052 1789

# View Code

Problem : 2037 ( 今年暑假不AC )     Judge Status : Accepted
RunId : 20114825    Language : C    Author : 837274600
Code Render Status : Rendered By HDOJ C Code Render Version 0.01 Beta
#include<stdio.h>
#include<string.h>
#include<math.h>

int main()
{
int n;
while (scanf("%d", &n) && n != 0)
{
int a[100][2], i, j, num = 0, x,temp;
for (i = 0; i < n; i++)
scanf("%d %d", &a[i][0], &a[i][1]);
for (i = 0; i < n; i++)
for (j = 0; j < n - i - 1; j++)
if (a[j][1] > a[j + 1][1])
{
temp = a[j][0];
a[j][0] = a[j + 1][0];
a[j + 1][0] = temp;
temp = a[j][1];
a[j][1] = a[j + 1][1];
a[j + 1][1] = temp;
}
x = 0;
for (i = 1; i < n; i++)
{
if (a[x][1] > a[i][0])
continue;
x = i;
num++;
}
printf("%d\n", num + 1);
}
return 0;
}