Submission #892569

#TimeUsernameProblemLanguageResultExecution timeMemory
892569ReLiceSuper Dango Maker (JOI22_dango3)C++17
100 / 100
265 ms920 KiB
#include <bits/stdc++.h> #include "dango3.h" #define ll int #define str string #define ins insert #define ld long double #define pb push_back #define pf push_front #define pof pop_front() #define pob pop_back() #define lb lower_bound #define ub upper_bound #define endl "\n" #define fr first #define sc second #define mpa make_pair #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() #define sz size() #define bc back() #define ar array #define vll vector<ll> using namespace std;/* #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds;*/ template <class _T> bool chmin(_T &x, const _T &y){ if(x>y){ x=y; return true; } return false; } template <class _T> bool chmax(_T &x, const _T &y){ bool flag=false; if (x<y){ x=y;flag|=true; } return flag; } //#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> void fre(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);} void start(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); } const ll mod=1e9+7; const ld eps=1e-9; void rec(vll v,ll m){ ll i,n=v.sz; if(m==1){ Answer(v); return; } vll nv; for(i=0;i<n;i++){ nv.pb(v[0]); v.erase(v.begin()); ll x=Query(v); if(x<m/2){ v.pb(nv.bc); nv.pob; } } rec(v,m/2); rec(nv,m-m/2); } void Solve(ll n,ll m){ vll v(n*m); iota(all(v),1); rec(v,m); } /* 1 7 1 2 2 3 3 4 4 5 3 6 6 7 2 4 1 5 7 */

Compilation message (stderr)

dango3.cpp: In function 'void fre(std::string)':
dango3.cpp:44:27: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 | void fre(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".out").c_str(),"w",stdout);}
      |                    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dango3.cpp:44:64: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   44 | void fre(string s){freopen((s+".in").c_str(),"r",stdin);freopen((s+".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...