5 条题解

  • 0
    @ 2025-2-27 14:35:14
    #include <bits/stdc++.h>
    using namespace std;
    typedef long long ll;
    
    int main(){
        vector<int> a;
        int n, t, pos;
        cin >> n;
        for (int i = 0; i < n; i++) {
            cin >> t;
            a.push_back(t);
        }
    
        cin >> pos;
        cin >> t;
        a.insert(a.begin() + pos - 1, t);
        for (int i = 0; i < a.size(); i++) {
            cout << a[i] << endl;
        }
    
        return 0;
    }
    

    信息

    ID
    71
    时间
    1000ms
    内存
    256MiB
    难度
    4
    标签
    递交数
    371
    已通过
    182
    上传者