답안 #675865

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
675865 2022-12-28T08:44:34 Z Kubeti XORanges (eJOI19_xoranges) C++14
30 / 100
3 ms 472 KB
#include <iostream>
#include <vector>
using namespace std;
int v[1001];
int main() {
    int n, q;
    cin>>n>>q;
    for(int i=1; i<=n; i++)
        cin>>v[i];
    for(int i=0; i<n; i++){
        int t;
        cin>>t;
        if(t == 1){
            int x, y;
            cin>>x>>y;
            v[x] = y;
        }
        else{
            int x, y;
            cin>>x>>y;
            if(abs(x-y)%2 == 1){
                cout<<0<<'\n';
            }
            else{
                int sum=0;
                for(;x<=y;x+=2)
                    sum^=v[x];
                cout<<sum<<'\n';
            }
        }
    }
    return 0;
}
 /*
int main(){
    int n;
    cin>>n;
    vector<vector<int>> v(n+1);
    for(int i=1; i<=n; i++){
        for(int j=i; j<=n; j++){
            for(int x=i; x<=j; x++)
                v[x].push_back(x);
        }
    }
    for(int i=1; i<=n; i++){
        for(auto it:v[i])
            cout<<it<<" ";
        cout<<"-> "<<v[i].size()<<endl;
    }
} */
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 212 KB Output is correct
2 Correct 3 ms 212 KB Output is correct
3 Correct 2 ms 316 KB Output is correct
4 Correct 2 ms 212 KB Output is correct
5 Correct 2 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 2 ms 212 KB Output is correct
7 Correct 3 ms 212 KB Output is correct
8 Correct 2 ms 316 KB Output is correct
9 Correct 2 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Runtime error 1 ms 440 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 472 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 304 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 304 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 2 ms 212 KB Output is correct
7 Correct 3 ms 212 KB Output is correct
8 Correct 2 ms 316 KB Output is correct
9 Correct 2 ms 212 KB Output is correct
10 Correct 2 ms 212 KB Output is correct
11 Runtime error 1 ms 440 KB Execution killed with signal 11
12 Halted 0 ms 0 KB -