# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
802694 | radaiosm7 | 벽 칠하기 (APIO20_paint) | C++11 | 1571 ms | 7800 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int n, m, x, y, l, s, i, mn;
vector<pair<int, int> > segs;
bool ok;
stack<pair<int, int> > S;
bool cmp(const pair<int, int>& a, const pair<int, int>& b) {
if (a.Y == b.Y) return a.X < b.X;
return a.Y < b.Y;
}
int minimumInstructions(int N, int M, int K, vector<int> C, vector<int> A, vector<vector<int> > B) {
for (y=0; y <= N-M; ++y) {
for (x=0; x < M; ++x) {
ok = true;
for (l=0; l < M && ok; ++l) ok &= binary_search(B[(x+l)%M].begin(), B[(x+l)%M].end(), C[y+l]);
if (!ok) continue;
segs.push_back(make_pair(y, y+M-1));
break;
}
}
sort(segs.begin(), segs.end(), cmp);
s = (int)segs.size();
if (s == 0) return -1;
mn = segs[0].X;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |