Submission #92931

# Submission time Handle Problem Language Result Execution time Memory
92931 2019-01-06T06:37:20 Z Makhsud Chessboard (IZhO18_chessboard) C++17
0 / 100
71 ms 376 KB
#include <bits/stdc++.h>
#define ll long long

ll n, k, x, y, xx, yy;
ll d;

using namespace std;

int main()
{
	cin >> n >> k;
	for ( int i = 1; i <= k; i ++ )
		cin >> x >> y >> xx >> yy;
	for ( int i = n-1; i >= 1; i -- ) {
		if ( n % i == 0 ) {
			d = i;
			break;
		}
	}
	if ( d == 1 ) {
		cout << (n*n) / 2;
	}
	else {
		//cout << d << '\n';
		if ( n % 2 == 0 ) {
			cout << (d*d) * (n/d);
		}
		else {
			cout << (d*d) * ((n/d) + 1);
		}
	}
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 71 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 71 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 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -