QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#95800#4389. Copy3360550356AC ✓485ms4180kbC++141.5kb2023-04-11 22:11:322023-04-11 22:11:33

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-11 22:11:33]
  • 评测
  • 测评结果:AC
  • 用时:485ms
  • 内存:4180kb
  • [2023-04-11 22:11:32]
  • 提交

answer

 #include <bits/stdc++.h>
#define endl '\n'
#define int long long 
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> PII;
const int N = 2e5+10;
const int M = 2e6 + 10;
const int mod = 998244353;
const int INF=1e9;
const double PI=acos(-1);
const double eps=1e-10;

int a[N];
void solve(){
	int n,q; 
	cin>>n>>q;
    for(int i = 1; i <= n; i++)cin>>a[i];
    int ans = 0;
    while(q--){
        int op;  cin>>op;
        if(op==1){
            int l, r;  cin>>l>>r;
            int len = r-l+1;
            for(int i = n; i >= r+1; i--)a[i] = a[i-len];
        }else{
            int x;  cin>>x;
            ans ^= a[x];
        }
    }
    cout<<ans<<endl;
}

signed main() {
	int T=1;
	cin>>T;
	while(T--) {
		solve();
	}
}

/**
*  ┏┓   ┏┓+ +
* ┏┛┻━━━┛┻┓ + +
* ┃       ┃
* ┃   ━   ┃ ++ + + +
*  ████━████+
*  ◥██◤ ◥██◤ +
* ┃   ┻   ┃
* ┃       ┃ + +
* ┗━┓   ┏━┛
*   ┃   ┃ + + + +Code is far away from  
*   ┃   ┃ + bug with the animarr protecting
*   ┃    ┗━━━┓ 神兽保佑,代码无bug 
*   ┃        ┣┓
*    ┃        ┏┛
*     ┗┓┓┏━┳┓┏┛ + + + +
*    ┃┫┫ ┃┫┫
*    ┗┻┛ ┗┻┛+ + + +
*/

詳細信息

Test #1:

score: 100
Accepted
time: 485ms
memory: 4180kb

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