| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1332906 | dusky | Monster-Go (EGOI25_monstergo) | C++20 | 1 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
vector<int> ans[55];
void cycle(int t, int n, int r) {
if (n == 4) { // 4 teams, 3 groups of 4
for (int i = t; i < t+4; i++) {
for (int j = r; j < r+12; j++) {
if ((j-r)%4 == i) continue;
ans[i].push_back(j);
}
}
} else if (n == 1) {
for (int j = r; j < r+12; j++) ans[t].push_back(j);
}
}
int main() {
int n, t = 0, r = 0; scanf("%d", &n);
if (n <= 16) {
while (n > 0) {
if (n >= 4) {
cycle(t, 4, r);
t += 4; n -= 4;
} else {
cycle(t, 1, r);
t++; n--;
} r += 12;
}
}
for (int i = 0; i < t; i++) {
for (int j : ans[i]) printf("%d ", j);
printf("\n");
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
