답안 #457692

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
457692 2021-08-07T09:55:33 Z mansur XORanges (eJOI19_xoranges) C++14
55 / 100
1000 ms 2204 KB
#include<bits/stdc++.h>

#pragma optimize ("g",on)
#pragma GCC optimize ("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC optimize ("03")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,avx2,mmx,fma,avx,tune=native")
             		
using namespace std;

#define all(a) a.begin(), a.end()
#define ll long long
#define pb push_back
#define nl '\n'
#define popb pop_back()
#define sz size()
#define ld long double
#define ull unsigned long long
#define F first
#define S second
#define fix fixed << setprecision
#define pii pair<int, int>
#define E exit (0)
#define int long long

const int inf = (1ll << 62ll), N = 1e5 + 1, mod = 998244353;                    

vector<pii> dd = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};

signed main() {
	//freopen("invtrans.in", "r", stdin);
	//freopen("invtrans.out", "w", stdout);
	ios_base::sync_with_stdio(NULL);
	cin.tie(NULL);
	int n, q;
	cin >> n >> q;
	int a[n + 1];
	for (int i = 1; i <= n; i++) cin >> a[i];
	while (q--) {
		int tp;
		cin >> tp;
		if (tp == 1) {
		    int i, j;
		   	cin >> i >> j;
		   	a[i] = j;
		}else {
			int l, r;
			cin >> l >> r;
			int ans = 0;
			for (int i = l; i <= r; i++) {
				if (((i - l + 1) * (r - i + 1)) & 1) ans ^= a[i];
			}                  
			cout << ans << nl;
		}
	}
}      

Compilation message

xoranges.cpp:3: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    3 | #pragma optimize ("g",on)
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 6 ms 332 KB Output is correct
12 Correct 6 ms 460 KB Output is correct
13 Correct 20 ms 460 KB Output is correct
14 Correct 20 ms 456 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1089 ms 2204 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 1 ms 204 KB Output is correct
8 Correct 1 ms 204 KB Output is correct
9 Correct 1 ms 204 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 6 ms 332 KB Output is correct
12 Correct 6 ms 460 KB Output is correct
13 Correct 20 ms 460 KB Output is correct
14 Correct 20 ms 456 KB Output is correct
15 Execution timed out 1089 ms 2204 KB Time limit exceeded
16 Halted 0 ms 0 KB -