Advertisement
Horikita_Suzune

Untitled

Jul 14th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.74 KB | None | 0 0
  1. #pragma GCC optimize("O3")
  2. #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
  3. #pragma comment(linker, "/stack:200000000")
  4. #include<ios>
  5. char buf[1<<17],*p1=buf,*p2=buf;
  6. inline int getc(){
  7. return p1==p2&&(p2=(p1=buf)+fread_unlocked(buf,1,1<<17,stdin),p1==p2)?EOF:*p1++;
  8. }
  9. inline void write(int x) {
  10. static int stk[9],top=0;
  11. int *ptr;
  12. ptr = &stk[0];
  13. while(x){*ptr=x%10;x/=10;ptr++;}
  14. ptr--;
  15. while(ptr>=(&stk[0])){putchar_unlocked(*ptr+'0');ptr--;}
  16. }
  17. inline int read() {
  18. int ret=0;
  19. char ch=getc();
  20. while(ch>='0'&&ch<='9')
  21. ret=(ret<<1)+(ret<<3)+ch-'0',ch=getc();
  22. return ret;
  23. }
  24. int main(){
  25.     int n,p=0,q=0,b;
  26.     n=read();
  27.     for(int i=0;i<n;i++){
  28.         b=read();
  29.         p=q&(p^b);
  30.         q=p|(q^b);
  31.     }
  32.     write(q);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement