### 题目描述

$$f(s)=\max \lbrace (s_1 \ xor \ s_2 \ xor \ \cdots \ xor \ s_i)+(s_{i+1} \ xor \ s_{i+2} \ xor \ \cdots \ xor \ s_{n})|i \in [0, n]\rbrace$$

### 代码

#include
#define min(a,b) (ab?a:b)
#define maxn 500000
int a[maxn],f[maxn<<2],n,mx;
int main(){
scanf("%d",&n);
memset(f,0x3f,sizeof(f));
for(register int i=1;i<=n;++i){
scanf("%d",&a[i]);
a[i]=a[i]^a[i-1];
f[a[i]]=min(f[a[i]],i);
mx=max(mx,a[i]);
}
for (register int i=mx;~i;--i)
for (register int j=19;~j;--j)
if (!(i&(1<
 
 Share 【UOJ 351】新年的叶子 / 题解 题目描述 对于一颗树，每次随机选择一个叶子，将其染黑，经过无数次操作以后，所有叶子将变成黑色。求期望在这之前的哪一时刻，不包含黑色点的直径长度第一次变小？ 思路 首先我们找到这棵树的直径。如果直径长度是偶数，所有直径必有一个必经点，… 06 Nov 2018 【Fortuna OJ 5947】初音未来 / 题解 题目描述 Hercier 作为一位喜爱 Hatsune Miku 的 OIer，痛下决心，将 Vocaloid 买回了家。打开之后，… 02 Nov 2018 
 
 
 Zepto's © 2024 Data & privacy Contact → Published with Ghost • Theme Attila • System theme 
 $(document).ready(function () { var viewport =$(window); var post = $('.post-content'); // Responsive videos with fitVids post.fitVids(); // Format code blocks and add line numbers function codestyling() {$('pre code').each(function(i, e) { // Code highlight hljs.highlightElement(e); // No lines for plain text blocks if (!$(this).hasClass('language-text')) { var code =$(this); // Calculate amount of lines var lines = code.html().split(/\n(?!$)/g).length; var numbers = []; if (lines > 1) { lines++; } for (i = 1; i < lines; i++) { numbers += '<span class="line" aria-hidden="true">' + i + '</span>'; } code.parent().append('<div class="lines">' + numbers + '</div>'); } }); } codestyling(); // Reading progress bar on window top function readingProgress() { var postBottom = post.offset().top + post.height(); var viewportHeight = viewport.height(); var progress = 100 - (((postBottom - (viewport.scrollTop() + viewportHeight) + viewportHeight / 3) / (postBottom - viewportHeight + viewportHeight / 3)) * 100);$('.progress-bar').css('width', progress + '%'); (progress > 100) ? $('.progress-container').addClass('complete'):$('.progress-container').removeClass('complete'); } readingProgress(); // Trigger reading progress viewport.on({ 'scroll': function() { readingProgress(); }, 'resize': function() { readingProgress(); }, 'orientationchange': function() { readingProgress(); } }); });