| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368562 | hahaha | Subset Mex (EGOI22_subsetmex) | C++20 | 2 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
const int N=58;
int n,t;
signed main(){
cin>>t;
vector<int>f;
while (t--) {
cin>>n;
vector<int> nado;
nado.pb(0);
for (int i=0; i<n; i++) {
nado.pb(1LL<<i);
}
reverse(nado.begin(), nado.end());
for (int i=0; i<n; i++) {
int x;
cin>>x;
f.pb(x);
}
int ans=1LL<<n;
for (int i=n-1; i>=0; i--) {
f[i]=min(f[i],nado[i]);
if(f[i]){
for(int j=i-1; j>=0; j--)
nado[j]-=f[i]<<(i-j-1);
}
ans-=min(f[i],nado[i])<<i;
}
cout<<ans<<endl;
f.clear();
}
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
