| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368804 | JelaByteEngineer | Subset Mex (EGOI22_subsetmex) | C++20 | 151 ms | 344 KiB |
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int t; cin>>t;
while (t--)
{
int n; cin>>n;
vector <ll> niz(n);
bool f=true;
priority_queue <int, vector <int>, greater<int>> kju;
for (int i=0; i<n; i++)
{
cin>>niz[i];
if (niz[i]>0) f=false;
if (niz[i]==0) kju.push(i);
}
if (!f)
{
int cnt=0;
while (!kju.empty())
{
int top=kju.top();
kju.pop();
niz[top]++;
for (int i=0; i<top; i++)
{
niz[i]--;
if (niz[i]==0) kju.push(i);
}
cnt++;
}
cout<<cnt+1<<endl;
}
else
{
cout<<1LL*(1<<n)<<endl;
}
}
return 0;
}
| # | 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... | ||||
