Submission #1077389

#TimeUsernameProblemLanguageResultExecution timeMemory
1077389mindiyakComparing Plants (IOI20_plants)C++14
0 / 100
1 ms348 KiB
#include "plants.h" #include <iostream> using namespace std; vector<int> R; void init(int k, std::vector<int> r) { R = r; return; } int compare_plants(int x, int y) { int a=x; int n = R.size(); // cerr << x << " " << y << endl; if(R[a] == 1){ a += 1; while((a%n) != y && R[(a%n)] == 0)a++; // cerr << "X - " << (a%n) << " -1" << endl; if((a%n) == y && R[y] == 0) return -1; } a = y; if(R[a] == 1){ a += 1; while((a%n) != x && R[(a%n)] == 0)a++; // cerr << "Y - " << (a%n) << " 1" << endl; if((a%n) == x && R[x] == 0) 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...