Advertisement
Horikita_Suzune

Untitled

Jul 20th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #pragma GCC optimize("O3,unroll-loops,no-stack-protector,fast-math")
  2. #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
  3. #include<cstdio>
  4. #include<stdint.h>
  5. char buf[1<<16],*p1=buf,*p2=buf;
  6. inline int getc(){
  7. return p1==p2&&(p2=(p1=buf)+fread_unlocked(buf,1,1<<16,stdin),p1==p2)?EOF:*p1++;
  8. }
  9. inline int read() {
  10. uint_fast64_t ret=0;
  11. char ch(getc());
  12. while(ch>='0'&&ch<='9')ret=(ret<<1)+(ret<<3)+ch-'0',ch=getc();
  13. return ret;
  14. }
  15. int main(){
  16.     uint_fast64_t n,p(0),q(0),b;
  17.     n=read();
  18.     for(int i(0);i<n;++i){
  19.         b=read();
  20.         p=q&(p^b);
  21.                 q=p|(q^b);
  22.     }
  23.     printf("%d",q);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement