답안 #290544

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
290544 2020-09-04T01:28:26 Z luysasg Chessboard (IZhO18_chessboard) C++17
8 / 100
143 ms 384 KB
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n, k;
	cin >> n >> k;
	if(k==0){
		long long int num=0,resp;
		for(int i=3;i<n;i+=2){
			if(n%i==0){
				num=n/i;
				break;
			}
		}
		if(num==0){
			resp=(n*n)/2;
		}
		else{
			long long int exp=num*num;
			long long int total=n*n;
			resp = (total-exp)/2;
		}
		cout << resp << endl;
	}
	else{
		int a, b, c, d, msm=0, dif=0;
		long long resp=0;
		for(int i=0;i<k;i++){
			cin >> a >> b >> c >> d;
			if(a%2 == b%2){
				msm++;
			}
			else{
				dif++;
			}
		}
		if(msm>dif){
			resp+=(dif+(((n*n)/2)+1-msm));
		}
		else{
			resp+=(msm+((n*n)/2-dif));
		}
		cout << resp << endl;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 143 ms 360 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 143 ms 360 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 0 ms 256 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 0 ms 256 KB Output is correct
5 Correct 0 ms 256 KB Output is correct
6 Correct 0 ms 256 KB Output is correct
7 Correct 0 ms 256 KB Output is correct
8 Correct 0 ms 256 KB Output is correct
9 Incorrect 143 ms 360 KB Output isn't correct
10 Halted 0 ms 0 KB -