Submission #921506

#TimeUsernameProblemLanguageResultExecution timeMemory
9215068pete8Sob (COCI19_sob)C++17
110 / 110
64 ms15800 KiB
#include<iostream> #include<stack> #include<map> #include<vector> #include<string> #include<unordered_map> #include <queue> #include<cstring> #include<cassert> #include<limits.h> #include<cmath> #include<set> #include<algorithm> #include<bitset> #include<stack> using namespace std; #define ll long long #define f first #define endl "\n" #define s second #define pii pair<int,int> #define pppiiii pair<pii,pii> #define ppii pair<int,pii> #define all(x) x.begin(),x.end() #define pb push_back #define mp make_pair #define lb lower_bound #define ub upper_bound #define fastio ios::sync_with_stdio(false);cin.tie(NULL); #define int long long const int mod=998244353,mxn=1e6+5,lg=30,inf=1e18,minf=-1e9,Mxn=100000,root=700; int n,m; void setIO(string name){ ios_base::sync_with_stdio(0); cin.tie(0); freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout); } bool del[mxn+10]; int32_t main(){ //setIO("lifeguards"); fastio cin>>n>>m; //greedy vector<pii>ans; for(int i=n-1;i>=0;i--){ for(int j=m;j<m+n;j++){ if(!del[j]&&((i&j)==i)){ while(i>=0&&j>=m&&!del[j]){ ans.pb({i,j}); del[j]=true; i--; j--; } } } } for(auto i:ans)cout<<i.f<<" "<<i.s<<'\n'; }

Compilation message (stderr)

sob.cpp: In function 'void setIO(std::string)':
sob.cpp:35:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   35 |  freopen((name+".in").c_str(),"r",stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sob.cpp:36:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   36 |  freopen((name+".out").c_str(),"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...