Submission #645621

# Submission time Handle Problem Language Result Execution time Memory
645621 2022-09-27T14:06:18 Z Kiarat Chessboard (IZhO18_chessboard) C++17
0 / 100
62 ms 212 KB
#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

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 time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -