# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
530455 | 2022-02-25T11:48:47 Z | ala2 | Mountains (IOI17_mountains) | C++14 | 0 ms | 308 KB |
#include<bits/stdc++.h> #include "mountains.h" #include <vector> using namespace std; int v[10010]; int a[10000]; int n; int mx; void f(int i) { if(i==n) { int is=0; for(int ii=0;ii<n;ii++) { for(int jj=ii+1;jj<n;jj++) { if(v[ii]==v[jj]&&v[ii]==1) { double m= ( (1.0*(a[jj]-a[ii]) ) / ( (jj-ii)*1.0) ); double b=a[ii]-m*ii; //int is=0; int bb=0; for(int k=ii+1;k<jj;k++) { int x=m*k+b; if(a[k]>x){ is=1; } } if(is==0) return ; } } } int g=0; for(int bb=0;bb<n;bb++) { // cout<<v[bb]<<" "; g+=v[bb]; } mx=max(mx,g); return ; } v[i]=0; f(i+1); v[i]=1; f(i+1); } int maximum_deevs(vector<int> y) { n=y.size(); for(int i=0;i<n;i++) a[i]=y[i]; mx=0; f(0); return mx; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 308 KB | Output is correct |
3 | Correct | 0 ms | 304 KB | Output is correct |
4 | Incorrect | 0 ms | 208 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 308 KB | Output is correct |
3 | Correct | 0 ms | 304 KB | Output is correct |
4 | Incorrect | 0 ms | 208 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 308 KB | Output is correct |
3 | Correct | 0 ms | 304 KB | Output is correct |
4 | Incorrect | 0 ms | 208 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 208 KB | Output is correct |
2 | Correct | 0 ms | 308 KB | Output is correct |
3 | Correct | 0 ms | 304 KB | Output is correct |
4 | Incorrect | 0 ms | 208 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |