제출 #398632

#제출 시각아이디문제언어결과실행 시간메모리
398632proma벽 칠하기 (APIO20_paint)C++17
0 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; int minimumInstructions (int N, int M, int K, vector <int> C, vector <int> A, vector <vector<int>> B) { if (N != M) { return -1; } for (int i = 0; i < M; i ++) { if (A[i] != 1) { return -1; } if (B[i][0] == C[0]) { int flag = 0; for (int l = 1; l < M; l ++) { if (B[(i + l) % M][0] != C[l]) { flag = 1; break; } } if (!flag) { return 1; } } } return -1; } /* void solve () { int N, M, K; vector <int> C, A; vector <vector<int>> B; cin >> N >> M >> K; C.resize(N); A.resize(M); B.resize(M); for (int i = 0; i < N; i ++) { cin >> C[i]; } for (int i = 0; i < M; i ++) { cin >> A[i]; B[i].resize(A[i]); for (int j = 0; j < A[i]; j ++) { cin >> B[i][j]; } } cout << minimumInstructions(N, M, K, C, A, B) << endl; } int main () { // solve(); 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...