Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120304 蔡胤泽 22数列变换III C++ Accepted 1 MS 272 KB 413 2025-05-25 11:26:28

Tests(2/2):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int a[108]; int n ,pos, tmp; cin >> n; for(int i = 1;i<= n;i++) { cin >> a[i]; } int m; cin >> m; for(int j = 1;j <=m;j++) { cin >> pos; tmp = a[pos]; for(int t = pos + 1;t <= n ;t++) { a[t -1] = a[t]; } a[n] = tmp; } for(int i = 1;i <= n;i++) { cout << a[i] <<" "; } return 0; }