# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
592819 | PiejanVDC | Aliens (IOI16_aliens) | C++17 | 1 ms | 304 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 "aliens.h"
#include <bits/stdc++.h>
using namespace std;
long long take_photos(int n, int m, int k, vector<int>r, vector<int>c) {
vector<pair<int,int>>v(n);
for(int i = 0 ; i < n ; i++)
v[i] = {r[i], c[i]};
sort(v.begin(), v.end());
long long ans = 0;
int mx = -1;
vector<vector<bool>>vis(m, vector<bool>(m, 0));
for(auto z : v) {
if(vis[z.first][z.second])
continue;
for(int i = min(z.first, z.second) ; i <= max(z.first, z.second) ; i++)
for(int j = min(z.first, z.second) ; j <= max(z.first, z.second) ; j++)
vis[i][j] = 1;
}
for(auto z : vis)
for(auto zz : z)
ans += zz;
return ans;
}
Compilation message (stderr)
# | 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... |