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>
#include "aliens.h"
using namespace std;
int g[50][50];
long long take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
if(n != k) exit(0);
for(int k = 0; k < n; k++) {
for(int i = r[k]; i <= c[k]; i++) {
for(int j = r[k]; j <= c[k]; j++) {
g[i][j] = 1;
}
}
}
int ret = 0;
for(int i = 0; i < m; i++) {
for(int j = 0; j < m; j++)
ret += g[i][j];
} return ret;
}
#ifdef LOCAL_TESTING
int main() {
freopen("in", "r", stdin);
int n, m, k;
assert(3 == scanf("%d %d %d", &n, &m, &k));
std::vector<int> r(n), c(n);
for (int i = 0; i < n; i++) {
assert(2 == scanf("%d %d", &r[i], &c[i]));
}
long long ans = take_photos(n, m, k, r, c);
printf("%lld\n", ans);
return 0;
}
#endif
# | 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... |