답안 #637391

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
637391 2022-09-01T15:41:32 Z ulianamalanyak XORanges (eJOI19_xoranges) C++14
55 / 100
1000 ms 4212 KB
#include <bits/stdc++.h>

using namespace std;

#define endl "\n"
#define INF 1e16
#define fi first
#define se second
#define pb push_back
#define in insert
#define speedup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;

//--------------------------------|
const int DIM=2e5+7;

ll n,m,k,l,r,q,t;
ll a[DIM];

//--------------------------------|

int main()
{
    speedup;

    cin >> n >> q;

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

    while(q--)
    {
        cin >> t;
        if (t==1)
        {
            cin >> k >> l;
            a[k]=l;
        }
        else
        {
            cin >> l >> r;
            if ((r-l+1)%2==0) cout << 0 << endl;
            else
            {
                ll tmp=1;
                ll res=0;
                for (int i=l;i<=r;i++)
                {
                    if (tmp%2!=0) res^=a[i];
                    tmp++;
                }
                cout << res << endl;
            }
        }
    }

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 292 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 292 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 4 ms 444 KB Output is correct
12 Correct 4 ms 468 KB Output is correct
13 Correct 11 ms 468 KB Output is correct
14 Correct 12 ms 468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1077 ms 4212 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 328 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 336 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 340 KB Output is correct
9 Correct 1 ms 292 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 4 ms 444 KB Output is correct
12 Correct 4 ms 468 KB Output is correct
13 Correct 11 ms 468 KB Output is correct
14 Correct 12 ms 468 KB Output is correct
15 Execution timed out 1077 ms 4212 KB Time limit exceeded
16 Halted 0 ms 0 KB -