답안 #505517

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
505517 2022-01-11T05:33:38 Z Mazaalai Chessboard (IZhO18_chessboard) C++17
8 / 100
1 ms 292 KB
#include <bits/stdc++.h>
using namespace std;
int n;
signed main() {
	cin >> n;
	// n = 6;
	int x = 1, ans = n * n / 2;
	for (int i = 2; i * i <= n; i++) {
		if (n % i == 0) {
			int j = n / i;
			ans = min(ans, j * j / 2 * i * i);
			swap(i, j);
			ans = min(ans, j * j / 2 * i * i);
			swap(i, j);
		}
	}
	cout << ans << '\n';
}

Compilation message

chessboard.cpp: In function 'int main()':
chessboard.cpp:7:6: warning: unused variable 'x' [-Wunused-variable]
    7 |  int x = 1, ans = n * n / 2;
      |      ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 292 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 0 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 0 ms 204 KB Output is correct
9 Incorrect 0 ms 204 KB Output isn't correct
10 Halted 0 ms 0 KB -