Submission #392255

# Submission time Handle Problem Language Result Execution time Memory
392255 2021-04-20T17:40:58 Z nishuz Poi (IOI09_poi) C++17
5 / 100
282 ms 23872 KB
// #pragma GCC optimize("Ofast,unroll-loops")
// #pragma GCC target("avx,avx2,sse,sse2")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
#define ll long long
#define ld long double
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
#define eb emplace_back
#define F first
#define S second
#define mp make_pair
#define random mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
 
template <typename T> using oset = tree <pair <T, T>, null_type, less <pair <T, T>>, rb_tree_tag, tree_order_statistics_node_update>;

template <typename Container>
void Print(Container& container, int starting) {
    auto Start = container.begin(), End = container.end();
    while (Start != End) cout << *(Start++) << " ";
    cout << '\n';
}
 
template <typename T>
void print(T&& t) {cout << t << '\n';}
 
template <typename T, typename... Args>
void print(T&& t, Args&&... args) {
    cout << t << " ";
    print(forward<Args>(args)...);
}

inline void solve() {
    #define tt tuple <int, int, int>
    int n, t, p;
    cin >> n >> t >> p;
    vector <vector <int>> A(n + 1, vector <int> (t + 1));
    vector <int> task(t + 1, n);
    vector <tt> points(n + 1);
    for (int i = 1; i <= n; ++i) {
        get<2>(points[i]) = i;
        for (int j = 1; j <= t; ++j) {
            cin >> A[i][j];
            task[j] -= A[i][j];
        }
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= t; ++j) {
            get<0>(points[i]) += (A[i][j] * task[j]);
            get<1>(points[i]) += A[i][j];
        }
    }
    sort(1 + all(points), [&](tt& a, tt& b) {
        if (get<0>(a) != get<0>(b)) return get<0>(a) > get<0>(b);
        if (get<1>(a) != get<1>(b)) return get<1>(a) > get<1>(b);
        return get<2>(a) < get<2>(b);
    });
    for (int i = 1; i <= n; ++i) {
        if (get<2>(points[i]) == p) {
            print(get<0>(points[i]), get<1>(points[i]));
            break;
        }
    }
}
 
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int T = 1;
    // cin >> T;
    for (int test = 1; test <= T; ++test) {
        // cout << "Case #" << test << ": ";
        solve();
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Output isn't correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Incorrect 1 ms 208 KB Output isn't correct
4 Correct 1 ms 204 KB Output is correct
5 Incorrect 1 ms 204 KB Output isn't correct
6 Incorrect 1 ms 332 KB Output isn't correct
7 Incorrect 1 ms 332 KB Output isn't correct
8 Incorrect 1 ms 328 KB Output isn't correct
9 Incorrect 2 ms 332 KB Output isn't correct
10 Incorrect 3 ms 464 KB Output isn't correct
11 Incorrect 9 ms 972 KB Output isn't correct
12 Incorrect 15 ms 1612 KB Output isn't correct
13 Incorrect 42 ms 3824 KB Output isn't correct
14 Incorrect 59 ms 5336 KB Output isn't correct
15 Incorrect 104 ms 9172 KB Output isn't correct
16 Incorrect 112 ms 9812 KB Output isn't correct
17 Incorrect 169 ms 14376 KB Output isn't correct
18 Incorrect 193 ms 16416 KB Output isn't correct
19 Incorrect 255 ms 21624 KB Output isn't correct
20 Incorrect 282 ms 23872 KB Output isn't correct