# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
692883 | 2023-02-02T06:51:31 Z | tolbi | Chessboard (IZhO18_chessboard) | C++17 | 25 ms | 2384 KB |
#pragma optimize("Bismillahirrahmanirrahim") //█▀█─█──█──█▀█─█─█ //█▄█─█──█──█▄█─█■█ //█─█─█▄─█▄─█─█─█─█ //Allahuekber //ahmet23 orz... //Sani buyuk Osman Pasa Plevneden cikmam diyor. //FatihSultanMehmedHan //YavuzSultanSelimHan //AbdulhamidHan #define author tolbi #include <bits/stdc++.h> #ifdef LOCAL #include "23.h" #endif #define int long long #define endl '\n' #define vint(x) vector<int> x #define deci(x) int x;cin>>x; #define decstr(x) string x;cin>>x; #define cinarr(x) for (auto &it : x) cin>>it; #define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl; #define sortarr(x) sort(x.begin(),x.end()) #define sortrarr(x) sort(x.rbegin(),x.rend()) #define det(x) cout<<"NO\0YES"+x*3<<endl; #define INF LONG_LONG_MAX #define rev(x) reverse(x.begin(),x.end()); #define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define tol(bi) (1LL<<((int)(bi))) const int MOD = 1e9+7; using namespace std; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); int32_t main(){ ios; int t=1; int tno = 0; if (!t) cin>>t; while (t-(tno++)){ deci(n);deci(k); int say = 0; for (int i = 0; i < k; i++){ deci(x1);deci(y1);deci(x2);deci(y2); x1--,y1--; say+=(x1%2)^(y1%2); } int blk = n*n/2; int whit = n*n-blk; cout<<min(blk-say+k-say,say+whit-(k-say))<<endl; } }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 320 KB | Output is correct |
2 | Correct | 7 ms | 596 KB | Output is correct |
3 | Correct | 12 ms | 1204 KB | Output is correct |
4 | Correct | 13 ms | 1100 KB | Output is correct |
5 | Correct | 17 ms | 1484 KB | Output is correct |
6 | Correct | 10 ms | 1108 KB | Output is correct |
7 | Correct | 3 ms | 468 KB | Output is correct |
8 | Correct | 11 ms | 1076 KB | Output is correct |
9 | Correct | 25 ms | 2384 KB | Output is correct |
10 | Correct | 14 ms | 1356 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 320 KB | Output is correct |
2 | Correct | 7 ms | 596 KB | Output is correct |
3 | Correct | 12 ms | 1204 KB | Output is correct |
4 | Correct | 13 ms | 1100 KB | Output is correct |
5 | Correct | 17 ms | 1484 KB | Output is correct |
6 | Correct | 10 ms | 1108 KB | Output is correct |
7 | Correct | 3 ms | 468 KB | Output is correct |
8 | Correct | 11 ms | 1076 KB | Output is correct |
9 | Correct | 25 ms | 2384 KB | Output is correct |
10 | Correct | 14 ms | 1356 KB | Output is correct |
11 | Incorrect | 0 ms | 212 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 1 ms | 212 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |