社区讨论

这个快读是怎么回事

P4722【模板】最大流 加强版 / 预流推进参与者 3已保存回复 5

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
5 条
当前快照
1 份
快照标识符
@misom9jt
此快照首次捕获于
2025/12/05 17:48
2 个月前
此快照最后确认于
2025/12/07 10:30
2 个月前
查看原帖
rt,这个题我使用 HLPP,加了快读跟普通版写的 Dinic 是一个效果(hack 和 Sub0 第一个点 AC,其他全 TLE),把快读删了就过了,有人能告诉我这是怎么回事吗。
我的快读长这样(从学长那里借鉴的,真的是借鉴的):
CPP
namespace FAST_IO {
#define IOSIZE (1<<20)
    char ibuf[IOSIZE], obuf[IOSIZE], *p1 = ibuf, *p2 = ibuf, *p3 = obuf;
#define getchar() ((p1==p2)and(p2=(p1=ibuf)+fread(ibuf,1,IOSIZE,stdin),p1==p2)?(EOF):(*p1++))
#define putchar(x) ((p3==obuf+IOSIZE)&&(fwrite(obuf,p3-obuf,1,stdout),p3=obuf),*p3++=x)
#define isdigit(ch) (ch>47&&ch<58)
#define isspace(ch) (ch<33)
#define print(x,c) write(x),putchar(c),flush()
    template <typename T> inline void read (T &x) {	x = 0; T f = 1;char ch = getchar ();while (!isdigit (ch)) {if (ch == '-') f = -1; ch = getchar ();}while (isdigit (ch)) {x = (x << 1) + (x << 3) + (ch ^ '0'); ch = getchar ();} x *= f;}
	template <> inline void read (double &x) { x = 0; int f = 1;char ch = getchar ();while (!isdigit (ch)) { if (ch == '-') f = -1; ch = getchar ();} while (isdigit (ch)) x = x * 10 + (ch - '0'), ch = getchar ();if (ch == '.') {ch = getchar (); for (double t = 0.1; isdigit (ch); t *= 0.1) x += t * (ch - '0'), ch = getchar ();}x *= f;}
	inline bool read(char *s) { char ch; while (ch = getchar(), isspace(ch)); if (ch == EOF) return false; while (!isspace(ch)) *s++ = ch, ch = getchar(); *s = '\000'; return true; }
	inline bool read(string& s) { s = ""; char ch; while (ch = getchar(), isspace(ch)); if (ch == EOF) return false; while (!isspace(ch)) s += ch, ch = getchar(); return true; }
	template <typename T, typename ...Args> inline void read (T &x, Args &...args) {read(x); read(args...);}
	template <typename T> inline void write (T x) {	if (x < 0) putchar ('-'), x = -x; if (x > 9) write (x / 10); putchar (x % 10 + 48);}
	inline void write(string x) { for (int i = 0, n = x.size(); i < n; i++) putchar(x[i]); }
	inline void write(char *x) { while (*x) putchar(*x++); }
	inline void write(const char *x) { while (*x) putchar(*x++); }
	inline void flush() { if (p3 != obuf) { fwrite(obuf, 1, p3 - obuf, stdout);p3 = obuf;}}
}
using namespace FAST_IO;

回复

5 条回复,欢迎继续交流。

正在加载回复...