睡前床头放一物 运行时间暴跌800+ms
查看原帖
睡前床头放一物 运行时间暴跌800+ms
1395519
_21_3tzhz楼主2024/10/25 09:14

printf改为快写

用非递归版本的快写可以进一步降低运行时间

inline void wr(int x) {
  static int sta[20];
  int top = 0;
  do {
    sta[top++] = x % 10, x /= 10;
  } while (x);
  while (top) putchar(sta[--top] + 48);
}
2024/10/25 09:14
加载中...