ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

help,why mine get WA?It's nearly the same as Pual said accepted below
Posted by Huang viend 5 Mar 2002 21:09
#include <stdio.h>
#include <iostream.h>
main() {
 long x,n;
 long double y1,y2,max;
 cin>>n;
 cin>>y1;
 cin>>y2;
 x=1;
 max=y2-y1;
 y1=y2;
 for (long i=3;i<=n;i++) {
   cin>>y2;
   if (y2-y1>max) {
    max=y2-y1;
    x=i-1;
   }
  y1=y2;
  }
 printf("%ld %ld",x,x+1);
}
because...
Posted by I have answers to all your questions :) 5 Mar 2002 22:17
inclination can't be negative, so u should use fabs :)