# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
446037 | prvocislo | Dominance (CEOI08_dominance) | C++17 | 18 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
struct obdl { int r1, c1, r2, c2; };
const ll inf = 1e10;
ll count(ll r1, ll c1, ll r2, ll c2) // spocita pocet platnych bodov, vratane
{
r1 += inf, c1 += inf, r2 += inf, c2 += inf;
ll even_rows = r2/2 - (r1-1)/2, odd_rows = r2 - r1 + 1 - even_rows;
ll even_columns = c2/2 - (c1-1)/2, odd_columns = c2 - c1 + 1 - even_columns;
return even_rows * even_columns + odd_rows * odd_columns;
}
struct udalost { ll x, y1, y2; int d; };
bool cmp(const udalost &a, const udalost &b) { return a.x < b.x; }
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int w, h, n;
cin >> w >> h >> n;
vector<udalost> e;
set<int> sy;
for (int i = 0, x, y, d; i < n; i++)
{
char c;
cin >> c >> x >> y >> d;
int delta = c == 'W' ? 1 : -1;
e.push_back({x-y-d, x+y-d, x+y+d+1, delta});
e.push_back({x-y+d+1, x+y-d, x+y+d+1, -delta});
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |