# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300400 | 2020-09-17T06:43:27 Z | daniel920712 | Comparing Plants (IOI20_plants) | C++14 | 2 ms | 2720 KB |
#include "plants.h" #include <stdio.h> #include <vector> #include <utility> using namespace std; vector < pair < int , int > > con[100005]; vector < int > all; int N; void init(int k,vector<int> r) { int a=0,b=0,i,j,ok=0; all=r; N=r.size(); for(i=0;ok==0;i++) { if(r[(i+N-1)%N]==1!=r[i]) { b=0; a++; con[i].push_back(make_pair(a,0)); for(j=i+1;r[(j+N-1)%N]==r[i];j=(j+1)%N) { //printf("%d %d\n",a,j); if(j==N-1) ok=1; b++; con[j].push_back(make_pair(a,b)); } i=(j+N-1)%N; } } return; } int compare_plants(int x, int y) { for(auto i:con[x]) { for(auto j:con[y]) { if(i.first==j.first) { if(i.second<j.second) return -1; return 1; } } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2720 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 2688 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |