제출 #438569

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
4385692021-06-28 09:03:32AmineTrabelsi식물 비교 (IOI20_plants)C++14
0 / 100
1 ms304 KiB
#include "plants.h"
#include <bits/stdc++.h>
using namespace std;
const int M = 200005;
int pref[M];
int n;
int sum(int l,int r){
//cerr << l <<" "<<r<<endl;
if(r < l){
return sum(0,r)+sum(l,n-1);
}
return pref[r+1]-pref[l];
}
void init(int k, vector<int> r) {
n = r.size();
for(int i=0;i<n;i++){
pref[i+1] = pref[i]+r[i];
}
return;
}
bool istaller(int x,int y){
//cerr <<sum(x,(y > 0 ? y-1 : n-1))<<" "<<x<<" "<<(y > 0 ? y-1 : n-1)<<" "<<endl;
if(sum(x,(y > 0 ? y-1 : n-1)) == 0)return true;
int range = sum(0,n-1)-sum(x,y);
if(range == n-abs(x-y)-1)return true;
return false;
}
int compare_plants(int x, int y) {
//cerr << 1 << endl;
if(istaller(x,y))return 1;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...