# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
559235 |
2022-05-09T14:29:46 Z |
AriaH |
Teams (IOI15_teams) |
C++17 |
|
78 ms |
23080 KB |
#include "teams.h"
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair < int, int > pii;
typedef pair < ll, ll > pll;
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define SZ(x) (int)x.size()
#define Mp make_pair
#define endl "\n"
#define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const int N = 5e5 + 10;
const int LOG = 20;
const ll mod = 1e9 + 7;
const ll inf = 8e18;
int n, pre[N], suf[N];
ll ps[N];
void init(int _n, int A[], int B[])
{
n = _n;
for(int i = 0; i < n; i ++)
{
pre[B[i]] ++;
suf[A[i]] ++;
}
for(int i = 1; i <= n + 1; i ++)
{
pre[i] += pre[i - 1];
}
for(int i = n; i >= 0; i --)
{
suf[i] += suf[i + 1];
}
}
int can(int m, int arr[])
{
sort(arr, arr + m);
ll sum = 0, Best = 0;
for(int i = 0; i < m; i ++)
{
sum += arr[i];
if(sum > n) return 0;
ll now = sum + suf[arr[i] + 1] + Best;
if(now > n) return 0;
Best = max(Best, sum - pre[arr[i] - 1]);
}
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
1876 KB |
Output is correct |
2 |
Correct |
7 ms |
1876 KB |
Output is correct |
3 |
Incorrect |
6 ms |
1876 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
12 ms |
2256 KB |
Output is correct |
2 |
Correct |
12 ms |
2260 KB |
Output is correct |
3 |
Incorrect |
21 ms |
5136 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
9532 KB |
Output is correct |
2 |
Correct |
54 ms |
16328 KB |
Output is correct |
3 |
Incorrect |
78 ms |
23080 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |