Submission #1048525

#TimeUsernameProblemLanguageResultExecution timeMemory
1048525IUA_HasinComparing Plants (IOI20_plants)C++17
0 / 100
1 ms688 KiB
#include "plants.h" #include <bits/stdc++.h> #define ll long long using namespace std; ll a, n; vector<ll> arr; void init(int k, std::vector<int> r) { a = k; n = r.size(); for(int i=0; i<r.size(); i++){ arr.push_back(r[i]); } return; } int compare_plants(int x, int y) { ll temp = arr[x]; ll temp2 = arr[y]; if(y==n-1){ if(x==0){ if(temp2>0){ return -1; } else { return 1; } } else { return 0; } } else { if(y==x+1){ if(temp>0){ return 1; } else { return -1; } } else { return 0; } } }

Compilation message (stderr)

plants.cpp: In function 'void init(int, std::vector<int>)':
plants.cpp:14:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for(int i=0; i<r.size(); 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...