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 "aliens.h"
#include <bits/stdc++.h>
using namespace std;
#define n N
#define m M
#define k K
#define int long long
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define fi first
#define se second
int n, m, k;
vector<int> a, b;
vector<vector<bool> > v;
int solve() {
v.assign(m, vector<bool> (m, false));
for(int i = 0; i < n; i++) {
int l = min(a[i], b[i]);
int r = max(a[i], b[i]);
for(int x = l; x <= r; x++) {
for(int y = l; y <= r; y++) {
v[x][y] = true;
}
}
}
int ans = 0;
for(int i = 0; i < m; i++) {
for(int j = 0; j < m; j++) {
if(v[i][j]) {
ans++;
}
}
}
return ans;
}
#undef n
#undef m
#undef k
int take_photos(signed n, signed m, signed k, vector<signed> r, vector<signed> c) {
N = n;
M = m;
K = k;
a.assign(N, 0);
b.assign(N, 0);
for(int i = 0; i < N; i++) {
a[i] = r[i];
b[i] = c[i];
}
return solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |