Submission #148831

# Submission time Handle Problem Language Result Execution time Memory
148831 2019-09-01T05:12:38 Z Torat(#3726, Osama_Alkhodairy, mohammedehab2002, mahmoudbadawy) Crosses on the Grid (FXCUP4_cross) C++17
0 / 100
387 ms 384 KB
#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));
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Incorrect 387 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Incorrect 387 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 384 KB Output is correct
2 Correct 5 ms 384 KB Output is correct
3 Incorrect 387 ms 384 KB Output isn't correct
4 Halted 0 ms 0 KB -