답안 #1118031

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1118031 2024-11-24T18:30:12 Z boris_7 XORanges (eJOI19_xoranges) C++17
12 / 100
1000 ms 2384 KB
#include<bits/stdc++.h>

using namespace std;
using ll =  long long;

void solve(){
    int n,q;
    cin>>n>>q;
    vector<int>v(n);
    for(int &i:v){
        cin>>i;
    }
    while(q--){
        int type;
        cin>>type;
        if(type==1){
            int ind,x;
            cin>>ind>>x;
            v[--ind]=x;
        }
        else{
            int l,r;
            cin>>l>>r;
            --l,--r;
            ll ans = 0;
            for(int i = l;i<=r;i++){
                for(int j = i;j<=r;j++){
                    for(int k = i;k<=j;k++){
                        ans^=v[k];
                    }
                }
            }
            cout<<ans<<endl;
        }
    }
}

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    // ll t;cin>>t;while(t--)
        solve();
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 4 ms 460 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 422 ms 336 KB Output is correct
2 Correct 341 ms 336 KB Output is correct
3 Correct 495 ms 504 KB Output is correct
4 Execution timed out 1047 ms 460 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 4 ms 460 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
6 Correct 422 ms 336 KB Output is correct
7 Correct 341 ms 336 KB Output is correct
8 Correct 495 ms 504 KB Output is correct
9 Execution timed out 1047 ms 460 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1042 ms 2384 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 4 ms 460 KB Output is correct
5 Correct 4 ms 504 KB Output is correct
6 Correct 422 ms 336 KB Output is correct
7 Correct 341 ms 336 KB Output is correct
8 Correct 495 ms 504 KB Output is correct
9 Execution timed out 1047 ms 460 KB Time limit exceeded
10 Halted 0 ms 0 KB -