Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

贴代码,这题主要是思路

Posted by 200861516 at 2013-07-16 20:24:12 on Problem 3183
#include <stdio.h>
#include <string.h>

int main()
{
    int n,i,p,hgt[50010];
    scanf("%d",&n);
    memset(hgt,0,sizeof(hgt));
    for(i=1;i<=n;i++)
    {
        scanf("%d",&hgt[i]);
    }
    p=1;
    while(p<=n)
    {
        while(hgt[p]<hgt[p+1])  p++;
        printf("%d\n",p);
        while(hgt[p]>hgt[p+1])  p++;
        if(hgt[p]==hgt[p+1]) p++;
    }
}

程序有很多可以改的地方,不过A了就懒得改了

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator