QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#411883#4389. Copymobbb#AC ✓115ms3992kbC++20752b2024-05-15 21:07:422024-05-15 21:07:42

Judging History

你现在查看的是最新测评结果

  • [2024-05-15 21:07:42]
  • 评测
  • 测评结果:AC
  • 用时:115ms
  • 内存:3992kb
  • [2024-05-15 21:07:42]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define ll long long

void solve(){
    int n,q;
    cin >> n >> q;
    vector<int> a(n + 1);

    for (int i = 1;i <= n;i++){
        cin >> a[i];
    }

    int res = 0;
    for(int i = 1, op, x , y; i <= q; i ++ ) {
        cin >> op;
        if(op == 1){
            cin >> x >> y;
            a.insert(a.begin() + y + 1, a.begin() + x , a.begin() + y + 1);
            a.resize(n + 1);
        }else {
            cin >> x;
            res ^= a[x];
        }
    }
    cout << res << "\n";
    return ;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--){
        solve();
    }

    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 115ms
memory: 3992kb

input:

2
5 10
14138491 23289232 33892225 43531245 54436322
1 1 4
2 2
2 3
2 4
2 5
1 2 4
2 2
2 3
2 4
2 5
99990 99990
493133979 94198606 751145654 147404311 601524088 744747426 561746143 212260573 241231749 810352224 81276441 382492450 18779020 317505899 880615584 654793240 417574821 822313301 140569958 69317...

output:

28631531
787379207

result:

ok 2 lines