# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
980371 | 2024-05-12T06:33:58 Z | sleepntsheep | Painting Walls (APIO20_paint) | C++17 | 0 ms | 348 KB |
#include "paint.h" #include<stdlib.h> #include <vector> /* * * * * */ #define NN 100000 #define MM 50000 #define KK 100000 void push(int**eh,int*eo,int i,int j) { int o=eo[i]++; if(!o)eh[i]=(int*)malloc(2*sizeof**eh); else if(!(o&o-1))eh[i]=(int*)realloc(eh[i],2*o*sizeof**eh); eh[i][o]=j; } int*eh[MM], eo[MM]; int*fh[KK],fo[KK]; int freq[NN]; int minimumInstructions( int N, int M, int K, std::vector<int> C, std::vector<int> A, std::vector<std::vector<int>> B) { for(int i=0;i<N;++i)push(fh,fo,C[i],i); for(int i=0;i<M;++i) for(int j=0;j<A[i];++j) for(int k=0;k<fo[B[i][j]];++j) if(!freq[fh[B[i][j]][k]]++) push(eh,eo,i,fh[B[i][j]][k]); // should not push more than O(400000) return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |