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;
typedef long long ll;
ll solveSubtask1(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
bool grid[m][m];
memset(grid,0, sizeof grid);
for(int i=0; i<n; i++) {
int x = r[i], y = c[i];
if(y < x) swap(x, y);
for(int j=x; j <= y; j++)
for(int k = x; k <= y; k++)
grid[j][k] = 1;
}
int ans = 0;
for(int i=0; i<m; i++)
for(int j=0; j<m; j++)
ans += grid[i][j];
return ans;
}
ll take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
if(n <= 50 && m <= 100) return solveSubtask1(n, m, k, r, c);
return 0;
}
# | 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... |