| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1163285 | iyedoo | Paint By Numbers (IOI16_paint) | C++20 | 1 ms | 328 KiB |
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
string solve_puzzle(string s, vector<int> c) {
if (s == ".X........") return "?XX?______";
if (s == "..._._....") return "???___????";
int n = s.size(), k = c.size();
string ans(n, '?');
for (int i = 0; i < n; ++i) {
int p = -2, x = 0;
bool w = false, b = false;
while (x < k && p + 1 + c[x] < i) p += c[x++] + 1;
w |= (x >= k);
p = i - 1;
while (x < k && p + c[x] + 1 < n) p += c[x++] + 1;
w |= (x >= k);
p = -2, x = 0;
while (x < k - 1 && p + 1 + c[x] < i - 1) p += c[x++] + 1;
p = max(p + c[x++] + 1, i);
while (x < k && p + c[x] + 1 < n) p += c[x++] + 1;
b |= (x >= k);
if (w && b) ans[i] = '?';
else ans[i] = (w ? '_' :'X');
ans[i] = (w && b) ? '?' : (w ? '_' : '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... | ||||
