답안 #398632

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
398632 2021-05-04T16:01:18 Z proma 벽 칠하기 (APIO20_paint) C++17
0 / 100
1 ms 204 KB
#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;
}
*/
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -