Submission #359592

#TimeUsernameProblemLanguageResultExecution timeMemory
359592juggernautComparing Plants (IOI20_plants)C++14
0 / 100
1 ms492 KiB
#include"plants.h" using namespace std; int pref[200005]; void init(int k, vector<int> r){ for(int i=0;i<r.size();i++)pref[i+1]=pref[i]+r[i]; } int compare_plants(int x, int y){ if(pref[y]-pref[x] == 0)return 1; else if(pref[y]-pref[x]==y-x)return -1; return 0; }

Compilation message (stderr)

plants.cpp: In function 'void init(int, std::vector<int>)':
plants.cpp:5:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    5 |     for(int i=0;i<r.size();i++)pref[i+1]=pref[i]+r[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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...