Submission #1110214

#TimeUsernameProblemLanguageResultExecution timeMemory
1110214vjudge1Card Collection (JOI24_collection)C++17
11 / 100
73 ms1096 KiB
#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)

Main.cpp: In function 'int main()':
Main.cpp:12:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |         freopen("c.INP","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:13:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         freopen("c.OUT","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...