Submission #645621

#TimeUsernameProblemLanguageResultExecution timeMemory
645621KiaratChessboard (IZhO18_chessboard)C++17
0 / 100
62 ms212 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll a[100001 * 4]; int main() { ll n,k; cin >> n >> k; ll oo = 0; ll qwe = 0; if(n % 2 == 0) oo = n / 2 * n; else if(n % 2 == 1) qwe = n / 2 * n + (n/2); if(k == 0) { if(n % 2 == 0) cout << n / 2 * n; else if(n % 2 == 1) cout << n / 2 * n + (n/2); } else { ll ans = 0,sum = 0,cnt = 0,ss = 0,ww = 0; ll x = k; while(k--) { ll x1,y1,x2,y2; cin >> x1 >> y1 >> x2 >> y2; if(x1 == x2 && y1 == y2) { if(x1 % 2 == 1 && x1 % 2 == y1 % 2) ss++; else if(x1 % 2 == 0 && x1 % 2 == y1 % 2) { ss++; } } } ww = x - ss; ans = oo - ss + ww; sum = qwe - ww + ss; cout << min(ans,sum); } } /// cout << fixes << serprecision(x) << " "

Compilation message (stderr)

chessboard.cpp: In function 'int main()':
chessboard.cpp:33:24: warning: unused variable 'cnt' [-Wunused-variable]
   33 |     ll ans = 0,sum = 0,cnt = 0,ss = 0,ww = 0;
      |                        ^~~
#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...