제출 #306491

#제출 시각아이디문제언어결과실행 시간메모리
306491giorgikob식물 비교 (IOI20_plants)C++14
0 / 100
1 ms384 KiB
#include "plants.h" #include<bits/stdc++.h> #define ll long long #define ff first #define ss second #define pb push_back using namespace std; vector<int>v; int n; void init(int k, std::vector<int> r) { n = r.size(); if(k == 2){ v = r; } return; } bool check(int x,int y){ for(int i = x; i != y; i--){ if(i == 0) i = n-1; if(v[i] != 1){ return false; } } return true; } int compare_plants(int x, int y) { if(check((x-1+n)%n,(y-1+n)%n)) return 1; if(check((y-1+n)%n,(x-1+n)%n)) return -1; return 0; }
#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...