| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 28354 | 22级赵奕绚 | 【J】T2 | C++ | Accepted | 100 | 16 MS | 464 KB | 326 | 2024-04-14 14:38:29 |
#include<bits/stdc++.h> using namespace std; int n,a[100010],f; int main(){ cin >> n; int l=1,cnt=0,b=1; for(int i=1;i<=n;i++){ cin >> f; if(i>l) a[cnt++]=b; if(i+f>l){ l=i+f;b=i; } } if(l<n+1) a[cnt++]=b; cout << cnt << endl; for(int i=0;i<cnt;i++){ cout << a[i] << " "; } return 0; }