#include "cross.h"
long long crossSize(int inner, int outer)
{
long long ins = inner;
long long outs = outer;
return (2*ins*outs-ins*ins);
}
long long SelectCross(int K, std::vector<int> I, std::vector<int> O)
{
int N = I.size();
long long ans = 0;
for (int i = 0; i<N; i++)
{
//printf("%d %d -> %lld\n",I[i],O[i],crossSize(I[i],O[i]));
ans = std::max(ans, crossSize(I[i],O[i]));
}
return ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
6 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
384 KB |
Output is correct |
6 |
Correct |
90 ms |
3564 KB |
Output is correct |
7 |
Correct |
88 ms |
3692 KB |
Output is correct |
8 |
Correct |
89 ms |
3564 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
384 KB |
Output is correct |
2 |
Correct |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
6 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
384 KB |
Output is correct |
6 |
Correct |
90 ms |
3564 KB |
Output is correct |
7 |
Correct |
88 ms |
3692 KB |
Output is correct |
8 |
Correct |
89 ms |
3564 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 |
5 ms |
384 KB |
Output is correct |
3 |
Correct |
5 ms |
384 KB |
Output is correct |
4 |
Correct |
6 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
384 KB |
Output is correct |
6 |
Correct |
90 ms |
3564 KB |
Output is correct |
7 |
Correct |
88 ms |
3692 KB |
Output is correct |
8 |
Correct |
89 ms |
3564 KB |
Output is correct |
9 |
Incorrect |
5 ms |
384 KB |
Output isn't correct |
10 |
Halted |
0 ms |
0 KB |
- |