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;
ll take_photos(int n,int m,int k,vector<int>r,vector<int>c){
sort(r.begin(),r.end());
vector<int>v;
for(int i=1;i<n;i++)v.push_back(r[i]-r[i-1]+1);
ll ans=n;
sort(v.begin(),v.end());
n-=k;
for(int i=0;i<n;i++)ans+=v[i]*v[i]-2;
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... |