#include "messy.h"
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
typedef long long ll;
typedef long double ld;
#define endl "\n"
#define vll vector<ll>
#define sd second
#define ft first
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define pll pair<ll, ll>
#define mod 998244353
#define _set tree<pll, null_type, less<pll>, rb_tree_tag, tree_order_statistics_node_update>
#define inf (ll)1e15
#define PRESICION(x) cout.setf(ios::fixed,ios::floatfield); cout.precision(x);
#define dgb(x) cout<<#x<<" : "<<x<<"\n"
using namespace std;
using namespace __gnu_pbds;
ll dx[]={1, -1, 0, 0};
ll dy[]={0, 0, 1, -1};
inline ll sm(ll a, ll b){
return ((a%mod)+(b%mod))%mod;
}
inline ll ml(ll a, ll b){
return ((a%mod)*(b%mod))%mod;
}
inline ll rs(ll a, ll b){
return ((a%mod)-(b%mod)+mod)%mod;
}
ll bpow(ll a , ll b) {
if (b==0)return 1;
if (b%2!=0)return ((bpow(a, b-1)%mod)*(a%mod))%mod;
ll r=bpow (a ,b/ 2) ;
return ((r%mod)*(r%mod))%mod;
}
inline ll q(vector<ll>& v, ll d, ll e){
if(d>e)return 0;
return (d!=0 ? v[e]-v[d-1]: v[e]);
}
vector<int> restore_permutation(int n, int w, int r){
string s="";
for(int i=0; i<n; i++)s+='0';
vector<int> v(n, INT_MAX);
for(int i=0; i<n; i++){s[i]='1';add_element(s);}
compile_set();
for(int i=0; i<(1LL<<n); i++){
string s="";
for(int j=0; j<n; j++){
if((1LL<<j)&i)s+='1';
else s+='0';
}
bool n=check_element(s);
if(n==1){
ll cnt=0;
for(int j=0; j<s.size(); j++){
if(s[j]=='1')cnt++;
}
for(int j=0; j<s.size(); j++){
if(s[j]=='1')v[j]=min(v[j]*1LL, cnt);
}
}
}
for(int i=0; i<n; i++){v[i]--;}
return v;
}
Compilation message (stderr)
messy.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
messy_c.h:1:9: warning: #pragma once in main file
1 | #pragma once
| ^~~~
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |