Submission #1061042

#TimeUsernameProblemLanguageResultExecution timeMemory
1061042boyliguanhanMountains (IOI17_mountains)C++17
0 / 100
1 ms420 KiB
#include "mountains.h" #include<algorithm> int maximum_deevs(std::vector<int> y) { y.push_back(1e9+1); y.insert(y.begin(),1e9+1); int ans=0; y.erase(unique(y.begin(),y.end()),y.end()); for(int i=1;i<y.size()-1;i++) if(y[i]<y[i+1]&&y[i]<y[i-1]) ans++; return ans; }

Compilation message (stderr)

mountains.cpp: In function 'int maximum_deevs(std::vector<int>)':
mountains.cpp:8:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for(int i=1;i<y.size()-1;i++)
      |                 ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...