Submission #930372

#TimeUsernameProblemLanguageResultExecution timeMemory
930372vjudge1Towers (NOI22_towers)C++17
0 / 100
2009 ms20552 KiB
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; pair<int,int> arr[n]; map<int,int> x; map<int,int> y; for(int i = 0;i<n;i++)cin>>arr[i].first>>arr[i].second; for(int mask = 1;mask< (1<<n);mask++){ for(int i = 0;i<n;i++){x[arr[i].first]=0;y[arr[i].second]=0;} int cnt = 0; bool can = true; for(int i = 0;i<n;i++){ if(!((1<<i)&mask))continue; cnt++; x[arr[i].first]++; y[arr[i].second]++; if(x[arr[i].first]==3||y[arr[i].first]==3){can=false;break;} } can&=(cnt>=2); if(can){ for(int i = 0;i<n;i++){ if(!((1<<i)&mask))cout<<0; else{ cout<<1; } } return 0; } } }
#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...