Japan Alumni Group Summer Camp 2013 Warming Up

Submission #664026

Source codeソースコード

#include <bits/stdc++.h>
using namespace std;

int main() {
	long long int N;
	cin >> N;
	vector<long long int>A( N + 1 );
	long long int now = 0, input;
	for( size_t i = 1; i <= N; i++ ) {
		cin >> input;
		now ^= input;
		A[i] = now;
	}
	long long int ans = 0;
	pair<long long int, long long int>ansidx;
	for( size_t i = 0; i <= N; i++ ) {
		for( size_t j = i + 1; j <= N; j++ ) {
			now = A[i] ^ A[j];
			if( now > ans ) {
				ans = now;
				ansidx = make_pair( i, j );
			}
		}
	}
	cout << ans << " " << ansidx.first + 1 << " " << ansidx.second << endl;
}

Submission

Task問題 F - Maximum Segment XOR
User nameユーザ名 120_goryudyuma
Created time投稿日時
Language言語 C++11 (GCC 4.8.1)
Status状態 WA
Score得点 0
Source lengthソースコード長 584 Byte
File nameファイル名
Exec time実行時間 ms
Memory usageメモリ使用量 -

Test case

Set

Set name Score得点 / Max score Cases
All 0 / 100 1,10,11,12,13,14,15,16,17,18,19,2,20,21,22,23,24,25,26,27,28,29,3,30,31,4,5,6,7,8,9

Test case

Case name Status状態 Exec time実行時間 Memory usageメモリ使用量
1 AC 28 ms 872 KB
10 AC 27 ms 932 KB
11 AC 25 ms 928 KB
12 AC 27 ms 924 KB
13 AC 51 ms 1052 KB
14 AC 66 ms 1052 KB
15 AC 75 ms 944 KB
16 TLE
17 AC 589 ms 1076 KB
18 TLE
19 AC 27 ms 924 KB
2 AC 27 ms 932 KB
20 AC 28 ms 924 KB
21 AC 29 ms 860 KB
22 AC 27 ms 1048 KB
23 AC 31 ms 876 KB
24 AC 28 ms 1048 KB
25 AC 41 ms 856 KB
26 AC 32 ms 1044 KB
27 AC 71 ms 988 KB
28 TLE
29 TLE
3 AC 27 ms 880 KB
30 AC 1274 ms 1264 KB
31 TLE
4 WA
5 AC 27 ms 1052 KB
6 AC 26 ms 936 KB
7 AC 29 ms 860 KB
8 AC 28 ms 872 KB
9 AC 38 ms 904 KB