# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1106233 | vladilius | Painting Walls (APIO20_paint) | C++17 | 549 ms | 524288 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
const int inf = 3e5;
int minimumInstructions(int n, int m, int k, vector<int> x, vector<int> A, vector<vector<int>> B){
vector<int> d[k];
for (int i = 0; i < m; i++){
for (int j: B[i]){
d[j].pb(i);
}
}
vector<int> T[n];
for (int i = 0; i < n; i++){
for (int j: d[x[i]]){
T[i].pb(j);
T[i].pb(j + m);
}
for (int j = 0; j < T[i].size(); j++) T[i][j] -= i;
}
vector<int> V[inf];
for (int i = 0; i < n; i++){
for (int j: T[i]){
V[j + n].pb(i);
}
}
vector<bool> gd(n);
for (int y = 0; y < inf; y++){
int i = 0;
while (i < V[y].size()){
int j = i;
while (j + 1 < V[y].size() && (V[y][j] + 1) == V[y][j + 1]) j++;
for (int t = V[y][i]; t <= V[y][j] - m + 1; t++) gd[t] = 1;
i = j + 1;
}
}
int mx = -1, t = -1, out = 0;
for (int i = 0; i < n; i++){
if (gd[i]) t = max(t, i);
if (i == (mx + 1)){
if (t == -1) return -1;
mx = t + m - 1;
t = -1;
out++;
}
}
return out;
}
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |