Rezultati

Up. imeNalogaJezikRezultatČas oddaje
pitoni-2017 Škatle C++ 100/100OK 20. apr '17 @ 17:33

Test Točke Porabljen spomin Porabljen čas Status
#1 6/6 3,133 MiB 0,004 s OK
#2 6/6 3,148 MiB 0,004 s OK
#3 6/6 3,133 MiB 0,004 s OK
#4 6/6 3,129 MiB 0,004 s OK
#5 6/6 3,137 MiB 0,004 s OK
#6 7/7 3,145 MiB 0,004 s OK
#7 7/7 3,133 MiB 0,004 s OK
#8 7/7 3,137 MiB 0,004 s OK
#9 7/7 3,129 MiB 0,004 s OK
#10 7/7 3,141 MiB 0,004 s OK
#11 7/7 3,207 MiB 0,004 s OK
#12 7/7 3,219 MiB 0,004 s OK
#13 7/7 3,219 MiB 0,004 s OK
#14 7/7 3,219 MiB 0,004 s OK
#15 7/7 3,145 MiB 0,004 s OK

Ocenjevani program (skatle.cpp):
#include <iostream>
#include <algorithm>
#include <array>
#include <complex>
#include <cmath>
#include <functional>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#include <utility>

using namespace std;

typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<double> vd;

bool ok(const vi& s, const vi& t) {
    for (int i = 0; i < s.size(); ++i) {
        if (s[i] >= t[i]) return false;
    }
    return true;
}

int main() {
    cin.sync_with_stdio(false);
    cin.tie(nullptr);
 
    int n, d;
    cin >> n >> d;
    
    vvi skatle(n, vi(d));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < d; ++j) {
            cin >> skatle[i][j];
        }
        sort(skatle[i].begin(), skatle[i].end());
    }
    sort(skatle.begin(), skatle.end());
    
    vi maks(n, 1);    
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < i; ++j) {
            if (ok(skatle[j], skatle[i])) {
                maks[i] = max(maks[i], maks[j] + 1);
            }
        }
    }
    
    cout << *max_element(maks.begin(), maks.end()) << endl;
    
    return 0;
}