CSES - Leirikisa 9.12.2021 - Results
Submission details
Task:Kartta
Sender:Mahtimursu
Submission time:2021-12-09 15:58:28 +0200
Language:C++ (C++17)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
#30
#40
Test results
testverdicttimegroup
#10.02 s1details
#20.02 s2details
#30.02 s3details
#40.04 s4details

Code

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define M 1000000007

int mp[101][101];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m, h;
    cin >> n >> m >> h;

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            cin >> mp[i][j];
        }
    }

    int mod = 33;

    int st = 0;

    // T1 pohja

    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            cout << "V";
        }
        cout << "\n";
    }
    st++;

    // T2, ... Tmod

    for (int k = 2; k <= mod; ++k) {
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                if (mp[i][j] % mod == k - 1) {
                    cout << "S";
                } else {
                    cout << "L";
                }
            }
            cout << "\n";
        }
        st++;
    }

    // Jäljellä 39 - mod + 1 = 7

    int left = 39 - mod + 1;

    // T(mod + 1), ...
    //cout << "------------------\n";
    //cout << st << endl;
    for (int md = mod; md <= h; md += mod) {
        if (left <= 0) break;
        left--;
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                if (mp[i][j] >= md) {
                    cout << "V";
                } else {
                    cout << "L";
                }
            }
            cout << "\n";
        }
        st++;
    }

    //cout << "---------------\n";

    while (left-- > 0) {
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < m; ++j) {
                cout << "V";
            }
            cout << "\n";
        }
        st++;
    }

    if (st != 40) {
        cout << st << endl;
        exit(-1);
    }

    cout << "1 1\n";
    for (int i = 1; i < h; ++i) {
        vector<int> ans;
        ans.push_back(1);

        for (int k = 1; k < (i % mod) + 1; ++k) {
            ans.push_back(k + 1);
        }

        int level = i / mod;
        if (level != 0)
            ans.push_back(level + mod);

        //cout << "H: " << i << " = ";

        cout << ans.size() << " ";
        for (int x : ans) {
            cout << x << " ";
        }
        cout << "\n";
    }


    return 0;
}

Test details

Test 1

Group: 1

Verdict:

input
100 100 40
40 11 38 24 5 31 40 10 17 33 1...

correct output
(empty)

user output
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV...
Truncated

Test 2

Group: 2

Verdict:

input
100 100 200
200 71 185 86 113 84 170 60 17...

correct output
(empty)

user output
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV...
Truncated

Test 3

Group: 3

Verdict:

input
100 100 1000
824 172 828 721 509 73 437 530...

correct output
(empty)

user output
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV...
Truncated

Test 4

Group: 4

Verdict:

input
100 100 10000
7110 9439 3392 1630 368 8481 1...

correct output
(empty)

user output
VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV...
Truncated