Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
119791 胡海峰老师 22数列变换III C++ Wrong Answer 0 MS 272 KB 489 2025-05-18 22:29:37

Tests(0/2):


Code:

#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<m;j++) a[j] = a[j+1]; a[m] = 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 */


Run Info:

------Input------
10 1 2 3 4 5 6 7 8 9 10 4 4 3 2 5
------Answer-----
1 5 6 7 9 10 4 3 2 8
------Your output-----
1 4 3 5 5 6 7 8 9 10