제출 #1332906

#제출 시각아이디문제언어결과실행 시간메모리
1332906duskyMonster-Go (EGOI25_monstergo)C++20
100 / 100
1 ms344 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) 메시지

Main.cpp: In function 'int main()':
Main.cpp:20:31: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |     int n, t = 0, r = 0; scanf("%d", &n);
      |                          ~~~~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...