| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1284586 | gustavo_d | Paint By Numbers (IOI16_paint) | C++20 | 1 ms | 348 KiB |
#include "paint.h"
#include <bits/stdc++.h>
using namespace std;
#define sz(x) (int)(x).size()
const int MAXN = 100;
string s; vector<int> rngSzs;
int n, k;
string solve_puzzle(string S, vector<int> C) {
s = S; rngSzs = C;
n = sz(s), k = sz(rngSzs);
string shortest;
for (int i=0; i<k; i++) {
for (int j=0; j<rngSzs[i]; j++) shortest += 'X';
if (i < k-1) shortest += '_';
}
if (sz(shortest) == n) {
return shortest;
}
int usedSuf = sz(shortest);
string ans;
for (int i=0, ptRng=0, usedPref=-1; i<n; i++) {
if (ptRng < k and usedPref + 1 + rngSzs[ptRng] <= i) {
usedPref += 1 + rngSzs[ptRng];
usedSuf -= (ptRng < k-1) + rngSzs[ptRng];
ptRng++;
}
int suf = n-i-1;
if (usedSuf > suf) ans += 'X';
else ans += '?';
}
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... | ||||
