[MtOI2019] Eternal Night's Retribution Problem Solution

topic

The mess in the title seems to be a persistent linear basis;

However~

One formula to do everything: a^b<=a+b

Then XORing all numbers is the answer;

#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    long long ans=0;
    for(register int i=1;i<=n;i++){
        int tmp;
        scanf("%d",&tmp);
        ans^=tmp;
    }
    cout << years;
}

 

Reprinted in: https://www.cnblogs.com/kamimxr/p/11590347.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326529332&siteId=291194637