Advertisement
Horikita_Suzune

Untitled

Jul 14th, 2019
286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
  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<<20],*p1=buf,*p2=buf;
  6. inline int getc(){
  7. return p1==p2&&(p2=(p1=buf)+fread_unlocked(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++;
  8. }
  9. inline void write(uint_fast16_t x){
  10. static int stk[6],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. uint_fast16_t 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. uint_fast16_t a;
  26. while(a=read()){
  27. for(int i=a-1;i>=1;--i){
  28. write(read()*i);
  29. putchar_unlocked(' ');
  30. }
  31. redn();
  32. if(a==1)putchar_unlocked('0');
  33. putchar_unlocked('\n');
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement