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>
#ifndef ARTHUR_LOCAL
#include "aliens.h"
#endif
using namespace std;
using ll = long long;
bool grid[101][101];
ll take_photos(int n, int m, int k, vector<int> R, vector<int> C)
{
for(int i=0; i<n; i++)
{
int x=R[i];
int y=C[i];
int cor = min(x,y);
int sid = max(x,y)-min(x,y);
for(int i=cor; i-cor<=sid; i++)
{
for(int j=cor; j-cor<=sid; j++)
{
grid[i][j]=1;
}
}
}
// for(int i=0; i<10; i++)
// {
// for(int j=0; j<10; j++)
// {
// cout << int(grid[i][j]) << " ";
// }
// cout << endl;
// }
int ans=0;
for(int i=0; i<101; i++)
{
for(int j=0; j<101; j++)
{
if(grid[i][j]) ans++;
}
}
return ans;
}
#ifdef ARTHUR_LOCAL
int main()
{
vector<int> V = {1,2};
cout << take_photos(2,10,1,V,V) << endl;
}
#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... |