Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
119792 | 胡海峰老师 | 22数列变换III | C++ | Accepted | 1 MS | 268 KB | 489 | 2025-05-18 22:33:06 |
#include <iostream> using namespace std; int a[108]; int main(){ int n,m,t,tmp; cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; cin>>m; for(int i=1;i<=m;i++) { cin>>t; tmp = a[t]; for(int j=t;j<n;j++) a[j] = a[j+1]; a[n] = tmp; } for(int i=1;i<=n;i++) cout<<a[i]<<" "; return 0; } /* Input 10 1 2 3 4 5 6 7 8 9 10 4 4 3 2 5 Output 1 5 6 7 9 10 4 3 2 8 5 1 2 3 4 5 3 2 4 1 3 4 2 5 1 */