제출 #92932

#제출 시각아이디문제언어결과실행 시간메모리
92932MakhsudChessboard (IZhO18_chessboard)C++17
0 / 100
74 ms376 KiB
#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 { ll cnt = 0; bool ch = false; for ( int i = 1; i <= n; i += d ) { ch = !ch; if ( ch ) { cnt += ( n / d ) / 2; } else { cnt += ( n / d + 1 ) / 2; } } cout << cnt * (d*d); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...