Submission #599354

#TimeUsernameProblemLanguageResultExecution timeMemory
599354inventiontimeCarnival Tickets (IOI20_tickets)C++17
11 / 100
1 ms692 KiB
#include "tickets.h"

#include <bits/stdc++.h>
using namespace std;

#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define pb push_back
#define re resize
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define loop(i, n) for(int i = 0; i < n; i++)
#define loop1(i, n) for(int i = 1; i <= n; i++)
#define print(x) cout << #x << ": " << x << endl << flush

typedef long long ll;
typedef vector<int> vi;
typedef array<int, 2> ii;
typedef array<int, 3> ti;
typedef vector<ii> vii;
typedef vector<ti> vti;
typedef vector<vi> vvi;
typedef priority_queue<int> pq;

template<class T> bool ckmin(T&a, T b) { bool B = a > b; a = min(a, b); return B; }
template<class T> bool ckmax(T&a, T b) { bool B = a < b; a = max(a, b); return B; }

const int inf = 1e17;
//const int maxn = ;

long long find_maximum(int k, vvi x) {

	int n = x.size();
	int m = x[0].size();

    if(m == 1 and k == 1) {

        vi v;
        loop(i, n) v.pb(x[i][0]);

        sort(all(v));
        ll res = 0;
        loop(i, n/2) res -= v[i];
        loop(i, n/2) res += v[n/2 + i];

        vvi answer;
        vi row(1, 0);
        loop(i, n) answer.pb(row);

        allocate_tickets(answer);

        return res;

    }

	return 1;

}

Compilation message (stderr)

tickets.cpp:28:17: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+17' to '2147483647' [-Woverflow]
   28 | const int inf = 1e17;
      |                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...