| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1316269 | nekolie | Painting Squares (IOI20_squares) | C++20 | 1 ms | 428 KiB |
#include "squares.h"
#include <bits/stdc++.h>
using namespace std;
const int k = 10;
vector<int> paint(int n){
vector<int> paimon;
if (n <= k) {
for (int i = 0; i < n; i++)
paimon.push_back(0);
}
else {
for (int i = 0; i < k; i++)
paimon.push_back(0);
int cnt = 1;
while (paimon.size() < n) {
for (int i = 0; i < cnt && paimon.size() < n; i++)
paimon.push_back(1);
for (int i = 0; i < k-cnt-1 && paimon.size() < n; i++)
paimon.push_back(0);
cnt++;
}
}
paimon.push_back(k);
return paimon;
}
bool czy(vector<int> &a, vector<int> &b, int x) {
for (int i = x; i < x+k; i++)
if (a[i] != b[i])
return false;
return true;
}
int find_location(int n, vector<int> c){
if (n <= k) {
int cnt = 0;
for (int i = 0; i < k; i++)
if (c[i] != -1)
cnt++;
return n-cnt;
}
else {
vector<int> oppai = paint(n);
for (int i = 1; i < k; i++)
oppai.push_back(-1);
for (int i = 0; i < n; i++)
if (czy(oppai,c,i))
return i;
}
}
컴파일 시 표준 에러 (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... | ||||
