| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 301402 | c4ts0up | Paint By Numbers (IOI16_paint) | C++17 | 1 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// c4ts0up
// Alvaro Bacca - COL3
#include "paint.h"
#include <bits/stdc++.h>
#define pb push_back
#define ff first
#define ss second
using namespace std;
int n, k;
vector <int> ps;
vector <int> ade, atr;
string cad;
// encuentra la interseccion de [a] union [b]. devuelve {-1,-1} si no hay
pair <int,int> interseccion(pair <int,int> a, pair <int,int> b) {
pair <int,int> res = {b.ff, a.ss};
if (b.ff > a.ss) return {-1,-1};
else return res;
}
string solve_puzzle(string s, vector<int> c) {
n = c.size();
k = s.size();
// llenamos el de adelante
for (int i=0; i<n; i++) {
for (int j=0; j<c[i]; j++) ade.pb(i+1);
if (ade.size()+1 <= k) ade.pb(-(i+1));
}
while (ade.size() < k) ade.pb(-n);
// llenamos el reverso
for (int i=n-1; i>=0; i--) {
for (int j=0; j<c[i]; j++) atr.pb(i+1);
if (atr.size()+1 <= k && i>0) atr.pb(-(i));
}
while (atr.size() < k) atr.pb(-n);
reverse(atr.begin(), atr.end());
/*//
cout << "ade := ";
for (int x : ade) cout << x << ", ";
cout << endl;
cout << "atr := ";
for (int x : atr) cout << x << ", ";
cout << endl;
//*/
// crea la cadena
for (int i=0; i<k; i++) {
if (ade[i] == atr[i]) cad += (ade[i] > 0 ? "X" : "_");
else cad += "?";
}
return cad;
}
컴파일 시 표준 에러 (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... | ||||
