| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 576568 | ParsaEs | 벽 칠하기 (APIO20_paint) | C++14 | 1055 ms | 13008 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//InTheNameOfGOD
//PRS;)
#include<bits/stdc++.h>
#include "paint.h"
#define rep(i, l, r) for(ll i = l; i < r; i++)
#define pb push_back
#define X first
#define Y second
typedef int ll;
using namespace std;
typedef pair<ll, ll> pi;
constexpr ll inf = 1e9;
ll minimumInstructions(ll N, ll M, ll K, vector<ll> C, vector<ll> A, vector<vector<ll>> B)
{
vector<ll> c[K + 1];
rep(i, 0, B.size()) for(ll j : B[i]) c[j].pb(i);
vector<ll> dp(N + 1, inf), cnt(M + 1, 0);
deque<pi> q;
ll gn = 0;
rep(i, 0, N)
{
if(M <= i) for(ll j : c[C[i - M]]) gn -= (cnt[(N + j - i) % M]-- == M);
for(ll j : c[C[i]]) gn += (++cnt[(N + j - i) % M] == M);
if(gn)
{
if(i == M - 1) dp[i] = 1;
else
{
while(!q.empty() && q.front().Y < i - M) q.pop_front();
if(!q.empty()) dp[i] = q.front().X + 1;
}
while(!q.empty() && q.back().X >= dp[i]) q.pop_back();
q.pb({dp[i], i});
}
}
return (dp[N - 1] >= inf ? -1 : dp[N - 1]);
}
컴파일 시 표준 에러 (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... | ||||
