#include "cross.h"
#include <bits/stdc++.h>
using namespace std;
long long SelectCross(int k,vector<int> d1,vector<int> d2)
{
int n=d1.size();
long long ans=0;
/*for (int i=0;i<(1<<n);i++)
{
if (__builtin_popcount(i)!=k)
continue;
long long mn1=1e18,mn2=1e18;
for (int j=0;j<n;j++)
{
if (i&(1<<j))
{
mn1=min(mn1,1LL*d2[j]);
mn2=min(mn2,1LL*d1[j]);
}
}
ans=max(ans,mn1*mn1-(mn1-mn2)*(mn1-mn2));
}*/
for (int i=0;i<n;i++)
ans=max(ans,1LL*d2[i]*d2[i]-1LL*(d2[i]-d1[i])*(d2[i]-d1[i]));
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
640 KB |
Output is correct |
6 |
Correct |
93 ms |
3688 KB |
Output is correct |
7 |
Correct |
96 ms |
3688 KB |
Output is correct |
8 |
Correct |
96 ms |
3692 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
640 KB |
Output is correct |
6 |
Correct |
93 ms |
3688 KB |
Output is correct |
7 |
Correct |
96 ms |
3688 KB |
Output is correct |
8 |
Correct |
96 ms |
3692 KB |
Output is correct |
9 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
6 ms |
384 KB |
Output is correct |
3 |
Correct |
6 ms |
384 KB |
Output is correct |
4 |
Correct |
5 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
640 KB |
Output is correct |
6 |
Correct |
93 ms |
3688 KB |
Output is correct |
7 |
Correct |
96 ms |
3688 KB |
Output is correct |
8 |
Correct |
96 ms |
3692 KB |
Output is correct |
9 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |