Submission #1355850

#TimeUsernameProblemLanguageResultExecution timeMemory
1355850gry3125Monster-Go (EGOI25_monstergo)C++20
14 / 100
1 ms344 KiB
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
using namespace std;

int main() {
    int n; cin >> n;
    if (n == 1 || n == 2 || n == 3 || n == 4) {
        for (int i = 1; i <= n; i++) {
            for (int j = 1; j <= 12; j++) {
                cout << (i-1)*12+j << " ";
            }
            cout << "\n";
        }
        return 0;
    }
    if (n == 13 || n == 26 || n == 39) {        
        for (int i = 1; i <= min(n,13); i++) {
            for (int j = 1; j <= 12; j++) {
                cout << (14-i == j ? 13 : j) << " ";
            }
            cout << "\n";
        }
        if (n <= 13) return 0; 
        n -= 13;
        for (int i = 1; i <= min(n,13); i++) {
            for (int j = 1; j <= 12; j++) {
                cout << (14-i == j ? 26 : j+13) << " ";
            }
            cout << "\n";
        }
        if (n <= 13) return 0;
        n -= 13;
        for (int i = 1; i <= min(n,13); i++) {
            for (int j = 1; j <= 12; j++) {
                cout << (14-i == j ? 39 : j+26) << " ";
            }
            cout << "\n";
        }
        return 0;
    }
    return 0;
}
#Result Execution timeMemoryGrader output
Fetching results...