Submission #1072812

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10728122024-08-24 05:32:22emptypringlescanBuilding Skyscrapers (CEOI19_skyscrapers)C++17
0 / 100
3555 ms1112 KiB
#include <bits/stdc++.h>
using namespace std;
struct custom_hash{
size_t operator()(pair<long long,long long> x) const{
return x.first*(1e9+5)+x.second;
}
};
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int32_t main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n,t;
cin >> n >> t;
pair<pair<int,int>,int> arr[n];
for(int i=0; i<n; i++){
cin >> arr[i].first.first >> arr[i].first.second;
arr[i].second=i;
}
sort(arr,arr+n);
do{
bool can=true;
unordered_set<pair<int,int>,custom_hash> got;
for(int i=0; i<n-1; i++){
bool nxt=false;
if(!i) nxt=true;
for(int j=0; j<i; j++){
if(abs(arr[i].first.first-arr[j].first.first)<=1&&abs(arr[i].first.second-arr[j].first.second)<=1) nxt=true;
}
if(!nxt) can=false;
if(!can) break;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...