Submission #597276

#TimeUsernameProblemLanguageResultExecution timeMemory
597276OzyPainting Walls (APIO20_paint)C++17
0 / 100
1 ms300 KiB
#include "paint.h" #include<bits/stdc++.h> using namespace std; #define lli int #define rep(i,a,b) for (int i = (a); i <= (b); i++) #define repa(i,a,b) for (int i = (a); i >= (b); i--) #define debug(a) cout << #a << " = " << a << endl #define debugsl(a) cout << #a << " = " << a << ", " #define MAX 20000 lli a,ini,n,m,k; int minimumInstructions(int N, int M, int K, std::vector<int> C,std::vector<int> A, std::vector<std::vector<int>> B) { n = N; m = M; k = K; a = -1; rep(i,0,m-1) { if (B[i][0] == C[0]) { a = i; break; } } if (a == -1) return -1; ini = a; lli res = 0; rep(i,0,n-1) { if (C[i] != B[a][0]) return -1; if (a == ini) res++; a++; a %= m; } return res; }
#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...