Submission #996319

#TimeUsernameProblemLanguageResultExecution timeMemory
996319Dan4LifePainting Walls (APIO20_paint)C++17
0 / 100
0 ms348 KiB
#include "paint.h" #include <bits/stdc++.h> using namespace std; int n, m, k; int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int>> B) { n = N, m = M, k = K; int x = -1, y = 0; for(int i = 0; i < M; i++){ for(auto col : B[i]) if(col==C[y]) x=i; } if(x==-1)return -1; while(M--){ bool found = false; for(auto col : B[x]) if(col==C[y]) found = true; if(!found) return -1; x++; if(x==M) x=0; y++; if(y==N) y=0; } return 1; }
#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...