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<iostream>
using namespace std;
int ar[105][105];
void color(int x,int y)
{
if(x > y) // pano apo diagonio
swap(x,y);
for(int i = x;i <= y;i++)
{
for(int j = x;j <= y;j++)
ar[i][j] = 1;
}
return;
}
long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) {
for(int i = 0;i < m;i++)
for(int j = 0;j < m;j++)
ar[i][j] = 0;
for(int i = 0;i < n;i++)
{
color(r[i],c[i]);
}
int ans = 0;
for(int i = 0;i < m;i++)
{
for(int j = 0;j < m;j++)
ans+=ar[i][j];
}
return ans;
}
# | 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... |