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>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef long double ld;
#define F first
#define S second
ll take_photos(int n, int m, int k, vector<int> r, vector<int> c) {
ll answer = 0;
vector<vector<bool>> used(m, vector<bool>(m));
for(int i = 0; i < n; i++) {
if(r[i] > c[i]) {
swap(r[i], c[i]);
}
int len = c[i] - r[i] + 1;
for(int row = r[i]; row < r[i]+len; row++) {
for(int col = r[i]; col < c[i]+len; col++) {
if(!used[row][col]) {
answer++;
used[row][col] = true;
}
}
}
}
return answer;
}
# | 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... |