| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1329631 | nathlol2 | 벽 칠하기 (APIO20_paint) | C++20 | 1605 ms | 291896 KiB |
#include "paint.h"
#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){
bool st[n];
memset(st, 0, sizeof st);
unordered_map<int, bool> mp[m];
for(int i = 0;i<m;i++){
for(int j = 0;j<a[i];j++){
mp[i][b[i][j]] = 1;
}
}
for(int i = 0;i<n - m + 1;i++){
for(int x = 0;x<m;x++){
bool ok = 1;
for(int j = 0;j<m && ok;j++){
if(!mp[(x + j) % m][c[i + j]]){
ok = 0;
break;
}
}
if(ok){
st[i] = 1;
break;
}
}
}
int ans = 0, id = 0, pv = 0;
while(id != n){
if(st[id]){
pv = id;
++ans;
id += m;
}else{
--id;
if(id < 0 || id == pv) return -1;
}
}
return ans;
}
| # | 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... | ||||
