|  | 
|  | 
| вернуться в форум | To admins(+) Послано maksay  8 мар 2008 00:24Tests 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
 | 
 | 
|