답안 #898248

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
898248 2024-01-04T12:03:50 Z irmuun 벽 칠하기 (APIO20_paint) C++17
0 / 100
0 ms 436 KB
#include<bits/stdc++.h>
#include "paint.h"
 
using namespace std;
 
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()

int minimumInstructions(int n,int m,int k,vector<int>C,vector<int>A,vector<vector<int>>B){
    if(n%m>0){
        return -1;
    }
    int s=0;
    for(int i=0;i<m;i++){
        if(B[i][0]==C[0]){
            s=i;
            break;
        }
    }
    bool ok=true;
    for(int i=0;i<n;i++){
        if(C[i]!=B[s][0]){
            ok=false;
            break;
        }
        s++;
        if(s==m) s-=m;
    }
    if(!ok) return -1;
    return n/m;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 436 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 436 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 436 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 436 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Incorrect 0 ms 436 KB Output isn't correct
5 Halted 0 ms 0 KB -