| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 107116 | tictaccat | Paint By Numbers (IOI16_paint) | C++14 | 3 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "paint.h"
#include <cstdlib>
#include <bits/stdc++.h>
using namespace std;
std::string solve_puzzle(std::string s, std::vector<int> c) {
int n = s.size(); int k = c.size();
string shortest;
for (int i = 0; i < k; i++) {
if (i != 0) shortest += '_';
for (int j = 0; j < c[i]; j++) shortest += 'X';
}
int minLen = shortest.size();
while (shortest.size() < n) shortest += '_';
//cout << shortest << "\n";
vector<bool> white(n,false), black(n,false);
for (int pos = 0; pos < n; pos++) {
//check white
int j;
for (j = 0; j <= pos+1; j++) {
//if (pos == n-1) cout << shortest[pos-j] << "\n";
if ((j == pos+1 || shortest[pos-j] == '_') && minLen + j <= n) {white[pos] = true; }
if ((j == pos+1 || shortest[pos-j] == 'X') && minLen + j <= n) black[pos] = true;
}
}
string ans = s;
for (int pos = 0; pos < n; pos++) {
assert(white[pos] || black[pos]);
if (white[pos] && black[pos]) ans[pos] = '?';
else if (white[pos]) ans[pos] = '_';
else if (black[pos]) ans[pos] = 'X';
}
return ans;
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
