警示后人 - TLE 80~95 pts
查看原帖
警示后人 - TLE 80~95 pts
912750
CarrotMeow楼主2023/8/3 10:38

题面:

  • 请注意数据读入对程序效率造成的影响。

如果你认为你的 AC 自动机没写挂,但是后几个点 TLE,请使用读入优化。

inline void read(string &s) {
    s = "";
    char c = getchar_unlocked();
    while (c < 'a' || c > 'z') c = getchar_unlocked();
    while (c >= 'a' && c <= 'z')
        s += c, c = getchar_unlocked();
}

inline void write(int x) {
    if (x < 10) return putchar_unlocked(x + '0'), void();
    write(x / 10);
    putchar_unlocked(x % 10 + '0');
}
2023/8/3 10:38
加载中...