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>
#ifdef EVAL
#else
#include"grader.cpp"
#endif
using namespace std;
typedef long long ll;
bool is[1005][1005],vis[505];
int len[1005];
ll take_photos(int n,int m,int k,vector<int>r,vector<int>c){
sort(r.begin(),r.end());
vector<pair<int,int>>v;
for(int i=1;i<n;i++)v.push_back({r[i]-r[i-1]+1,i-1});
ll ans=0;
sort(v.begin(),v.end());
for(int i=0;i<n-k;i++){
vis[v[i].second]=1;
vis[v[i].second+1]=1;
len[v[i].second]=max(len[v[i].second],v[i].first);
}
for(int i=0;i<n;i++)if(!vis[i])len[r[i]]=max(len[r[i]],1);
for(int i=0;i<m;i++)
for(int x=i;x<i+len[i];x++)
for(int y=i;y<i+len[i];y++)is[x][y]=1;
for(int i=0;i<m;i++)
for(int j=0;j<m;j++)ans+=is[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... |