194252025-12-09 09:52:32markfsibianFestés (50 pont)cpp17Wrong answer 0/50217ms128000 KiB
#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <cmath>

using namespace std;

int n, m, r[4], a;

vector<vector<int>> v;

vector<vector<int>> c;

int main()
{
    cin >> n >> m;
    for (int i = 1; i <= n; ++i)
        cin >> r[i];

    c.resize(m + 1);

    for (int i = 1; i <= m; ++i)
    {
        c[i].resize(n / 2 * (n + 1) + 1);
        for (int j = 1; j <= n / 2 * (n + 1); j++)
            cin >> c[i][j];
    }

    v.resize(n + 1);
    for (int i = 1; i <= n; ++i)
        v[i].resize(m + 1);

    for (int k = 1; k <= n; ++k)
        for (int j = 1; j <= m; ++j)
        {
            vector<int> t;
            for (int k1 = 1; k1 <= k; ++k1)
                for (int l = k; l <= n; ++l)
                    t.push_back(c[j][(k1 - 1) * n + (l - k1 + 1)]);
            t.push_back(r[k]);
            int foo = *min_element(t.begin(), t.end());
            if (foo == r[k])
                v[k][1] = (v[k][1] == 0) ? foo : v[k][1] ;
            else if (foo != r[k])
            {

            }
            v[k][j] = v[k][j] + foo;
        }

    for (int i = 1; i <= n; ++i)
    {
        for (int j = 1; j <= m; ++j)
            cout << v[i][j] << " ";
        cout << endl;
    }
    cout << endl;

    // C_jkl = c[i][(k-1)*n+(l-k+1)]
    
    // carry over last columnal num
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/01ms512 KiB
2Wrong answer0/02ms492 KiB
3Wrong answer0/2217ms7992 KiB
4Wrong answer0/22ms316 KiB
5Wrong answer0/319ms1540 KiB
6Runtime error0/2122ms128000 KiB
7Runtime error0/2101ms128000 KiB
8Runtime error0/2122ms128000 KiB
9Runtime error0/2120ms128000 KiB
10Runtime error0/2100ms128000 KiB
11Runtime error0/2119ms128000 KiB
12Runtime error0/296ms128000 KiB
13Runtime error0/2120ms128000 KiB
14Wrong answer0/2150ms7656 KiB
15Wrong answer0/3156ms7476 KiB
16Wrong answer0/3196ms7732 KiB
17Wrong answer0/2201ms7744 KiB
18Wrong answer0/3194ms7728 KiB
19Runtime error0/2119ms128000 KiB
20Runtime error0/2103ms128000 KiB
21Runtime error0/2122ms128000 KiB
22Runtime error0/2127ms128000 KiB
23Runtime error0/2120ms128000 KiB
24Runtime error0/297ms128000 KiB
25Runtime error0/2101ms128000 KiB