Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3,unroll-loops,no-stack-protector,fast-math")
- #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
- #include<cstdio>
- #include<stdint.h>
- char buf[1<<16],*p1=buf,*p2=buf;
- inline int getc(){
- return p1==p2&&(p2=(p1=buf)+fread_unlocked(buf,1,1<<16,stdin),p1==p2)?EOF:*p1++;
- }
- inline int read() {
- uint_fast64_t ret=0;
- char ch(getc());
- while(ch>='0'&&ch<='9')ret=(ret<<1)+(ret<<3)+ch-'0',ch=getc();
- return ret;
- }
- int main(){
- uint_fast64_t n,p(0),q(0),b;
- n=read();
- for(int i(0);i<n;++i){
- b=read();
- p=q&(p^b);
- q=p|(q^b);
- }
- printf("%d",q);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement