Submission #92940

# Submission time Handle Problem Language Result Execution time Memory
92940 2019-01-06T07:41:21 Z Makhsud Chessboard (IZhO18_chessboard) C++17
8 / 100
75 ms 376 KB
#include <bits/stdc++.h>
#define ll long long
using namespace std;

ll n, k, x, y, xx, yy;
ll d, mn = INT_MAX;

ll ch ( ll del ) {
	ll ans = 0;
	if ( del == 1 ) {
		return (n*n)/2;
	}
	for ( int i = 1; i <= (n/del); i ++ ) {
		if ( i % 2 == 1 ) {
			ans += (del*del) * ( (n/del) / 2 );

		}
		else {
			ans += (del*del) * ( ( ( n/del )+1) / 2 );

		}
	}
	return ans;
}

int main()
{
	cin >> n >> k;
	for ( int i = 1; i <= k; i ++ ) {
		cin >> x >> y >> xx >> yy;
	}
	for ( int i = 1; i < n; i ++ ) {
		if ( n % i == 0 ) {
			ll an = ch(i);

			mn = min ( mn, an );
		}
	}
	cout << mn;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 252 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 256 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 256 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Incorrect 75 ms 256 KB Output isn't correct
10 Halted 0 ms 0 KB -