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

Discussion of Problem 1126. Magnetic Storms

To admins(+)
Posted by maksay 8 Mar 2008 00:24
Tests for this probel are very weak.
Here it is code, that gets AC sn 0.488
you must have weak tests or very good computers=)
[code]
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>

using namespace std;
#define pb push_back

int i,j,a,b,n,m,k;
vector <int> mas;

int main()
{
    scanf("%d",&m);
    scanf("%d",&a);
    n=0;
    mas.clear();
    while (a!=-1)
    {
          mas.pb(a);
          scanf("%d",&a);
          n++;
    }
    for (i=0;i<n-m+1;i++)
    {
        printf("%d\n",*max_element(mas.begin()+i,mas.begin()+i+m));
    }
}
[/code]
So in my opinion you should add a test like this:
14000
1
2
3
...
25000
-1

or if even this program can pass it - decrease timelimit..thanks