fork download
  1. #pragma GCC optimize ("Ofast")
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. inline int my_getchar_unlocked(){
  5. static char buf[1048576];
  6. static int s = 1048576;
  7. static int e = 1048576;
  8. if(s == e && e == 1048576){
  9. e = fread_unlocked(buf, 1, 1048576, stdin);
  10. s = 0;
  11. }
  12. if(s == e){
  13. return EOF;
  14. }
  15. return buf[s++];
  16. }
  17. inline void rd(int &x){
  18. int k;
  19. int m=0;
  20. x=0;
  21. for(;;){
  22. k = my_getchar_unlocked();
  23. if(k=='-'){
  24. m=1;
  25. break;
  26. }
  27. if('0'<=k&&k<='9'){
  28. x=k-'0';
  29. break;
  30. }
  31. }
  32. for(;;){
  33. k = my_getchar_unlocked();
  34. if(k<'0'||k>'9'){
  35. break;
  36. }
  37. x=x*10+k-'0';
  38. }
  39. if(m){
  40. x=-x;
  41. }
  42. }
  43. inline int rd_int(void){
  44. int x;
  45. rd(x);
  46. return x;
  47. }
  48. struct MY_WRITER{
  49. char buf[1048576];
  50. int s;
  51. int e;
  52. MY_WRITER(){
  53. s = 0;
  54. e = 1048576;
  55. }
  56. ~MY_WRITER(){
  57. if(s){
  58. fwrite_unlocked(buf, 1, s, stdout);
  59. }
  60. }
  61. }
  62. ;
  63. MY_WRITER MY_WRITER_VAR;
  64. void my_putchar_unlocked(int a){
  65. if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
  66. fwrite_unlocked(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
  67. MY_WRITER_VAR.s = 0;
  68. }
  69. MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
  70. }
  71. inline void wt_L(char a){
  72. my_putchar_unlocked(a);
  73. }
  74. inline void wt_L(int x){
  75. int s=0;
  76. int m=0;
  77. char f[10];
  78. if(x<0){
  79. m=1;
  80. x=-x;
  81. }
  82. while(x){
  83. f[s++]=x%10;
  84. x/=10;
  85. }
  86. if(!s){
  87. f[s++]=0;
  88. }
  89. if(m){
  90. my_putchar_unlocked('-');
  91. }
  92. while(s--){
  93. my_putchar_unlocked(f[s]+'0');
  94. }
  95. }
  96. inline void wt_L(unsigned x){
  97. int s=0;
  98. char f[10];
  99. while(x){
  100. f[s++]=x%10;
  101. x/=10;
  102. }
  103. if(!s){
  104. f[s++]=0;
  105. }
  106. while(s--){
  107. my_putchar_unlocked(f[s]+'0');
  108. }
  109. }
  110. inline void wt_L(long long x){
  111. int s=0;
  112. int m=0;
  113. char f[20];
  114. if(x<0){
  115. m=1;
  116. x=-x;
  117. }
  118. while(x){
  119. f[s++]=x%10;
  120. x/=10;
  121. }
  122. if(!s){
  123. f[s++]=0;
  124. }
  125. if(m){
  126. my_putchar_unlocked('-');
  127. }
  128. while(s--){
  129. my_putchar_unlocked(f[s]+'0');
  130. }
  131. }
  132. inline void wt_L(unsigned long long x){
  133. int s=0;
  134. char f[21];
  135. while(x){
  136. f[s++]=x%10;
  137. x/=10;
  138. }
  139. if(!s){
  140. f[s++]=0;
  141. }
  142. while(s--){
  143. my_putchar_unlocked(f[s]+'0');
  144. }
  145. }
  146. int WRITER_DOUBLE_DIGIT = 15;
  147. inline int writerDigit_double(){
  148. return WRITER_DOUBLE_DIGIT;
  149. }
  150. inline void writerDigit_double(int d){
  151. WRITER_DOUBLE_DIGIT = d;
  152. }
  153. inline void wt_L(double x){
  154. const int d = WRITER_DOUBLE_DIGIT;
  155. int k;
  156. int r;
  157. double v;
  158. if(x!=x || (x==x+1 && x==2*x)){
  159. my_putchar_unlocked('E');
  160. my_putchar_unlocked('r');
  161. my_putchar_unlocked('r');
  162. return;
  163. }
  164. if(x < 0){
  165. my_putchar_unlocked('-');
  166. x = -x;
  167. }
  168. x += 0.5 * pow(0.1, d);
  169. r = 0;
  170. v = 1;
  171. while(x >= 10*v){
  172. v *= 10;
  173. r++;
  174. }
  175. while(r >= 0){
  176. r--;
  177. k = floor(x / v);
  178. if(k >= 10){
  179. k = 9;
  180. }
  181. if(k <= -1){
  182. k = 0;
  183. }
  184. x -= k * v;
  185. v *= 0.1;
  186. my_putchar_unlocked(k + '0');
  187. }
  188. if(d > 0){
  189. my_putchar_unlocked('.');
  190. v = 1;
  191. for(r=(0);r<(d);r++){
  192. v *= 0.1;
  193. k = floor(x / v);
  194. if(k >= 10){
  195. k = 9;
  196. }
  197. if(k <= -1){
  198. k = 0;
  199. }
  200. x -= k * v;
  201. my_putchar_unlocked(k + '0');
  202. }
  203. }
  204. }
  205. inline void wt_L(const char c[]){
  206. int i=0;
  207. for(i=0;c[i]!='\0';i++){
  208. my_putchar_unlocked(c[i]);
  209. }
  210. }
  211. inline void wt_L(string &x){
  212. int i=0;
  213. for(i=0;x[i]!='\0';i++){
  214. my_putchar_unlocked(x[i]);
  215. }
  216. }
  217. int main(){
  218. wt_L(1);
  219. wt_L(' ');
  220. wt_L(rd_int());
  221. wt_L('\n');
  222. return 0;
  223. }
  224. // cLay version 20201123-1
  225.  
  226. // --- original code ---
  227. // {
  228. // wt(1,rd_int());
  229. // }
  230.  
Time limit exceeded #stdin #stdout 5s 4424KB
stdin
Standard input is empty
stdout
Standard output is empty