| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1362592 | hsuan._.0528 | Subset Mex (EGOI22_subsetmex) | C++20 | 1 ms | 344 KiB |
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int maxn =3e5+10;
LL t, n, ans=0;
LL f[maxn];
void solve(){
cin>>n;
ans=0;
for(int i=0; i<n; i++) cin>>f[i];
LL need=1, ans=0;
for(int i=n-1; i>=0; i--){
ans+=max(0ll, need-f[i]);
need+=max(0ll, need-f[i]);
}
cout<<ans+1<<"\n";
}
signed main(){
ios_base::sync_with_stdio(0); cin.tie(0);
cin>>t;
while(t--) solve();
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... | ||||
