# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1110214 | vjudge1 | Card Collection (JOI24_collection) | C++17 | 73 ms | 1096 KiB |
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>
using namespace std;
int n,m;
set<pair<int,int>>f[30][30];
pair<int,int>a[20];
bool ktr[20];
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
if(fopen("c.INP","r")){
freopen("c.INP","r",stdin);
freopen("c.OUT","w",stdout);
}
cin >>n>>m;
for(int i=1;i<=n;i++){
int x,y;
cin >>x>>y;
f[i][i].insert({x,y});
}
for(int sz=2;sz<=n;sz++){
for(int i=1,j=sz;j<=n;i++,j++){
for(int h=i;h<j;h++){
for(auto u:f[i][h]){
for(auto v:f[h+1][j]){
f[i][j].insert({max(u.first,v.first),max(u.second,v.second)});
f[i][j].insert({min(u.first,v.first),min(u.second,v.second)});
}
}
}
}
}
for(int i=1;i<=m;i++){
int x,y;
cin >>x>>y;
a[i]={x,y};
}
for(auto o:f[1][n]){
for(int i=1;i<=m;i++){
if((a[i].first==o.first)&&(a[i].second==o.second))ktr[i]=true;
}
}
for(int i=1;i<=m;i++){
if(ktr[i])cout <<i<<' ';
}
}
Compilation message (stderr)
# | 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... |