执行用时:18ms
内存消耗:3.75MB
击败了100.00%的用户
击败了100.00%的用户
#pragma GCC optimize("O2")
#pragma GCC optimize("O3")
#include <unistd.h>
#include <queue>
using namespace std;
static char inBuf[1 << 16];
static int inLen = 0, inPos = 0;
inline int readChar() {
if (inPos == inLen) {
inLen = read(0, inBuf, sizeof(inBuf));
inPos = 0;
if (inLen <= 0) return -1;
}
return inBuf[inPos++];
}
inline int readInt() {
int c = readChar();
while (c <= ' ') { if (c == -1) return 0; c = readChar(); }
int x = 0;
while (c > ' ') { x = (x << 3) + (x << 1) + (c - '0'); c = readChar(); }
return x;
}
static char outBuf[1 << 16];
static int outLen = 0;
inline void flushOut() {
if (outLen > 0) { write(1, outBuf, outLen); outLen = 0; }
}
inline void outStr(const char* s) {
while (*s) {
if (outLen == (int)sizeof(outBuf)) flushOut();
outBuf[outLen++] = *s++;
}
}
const int MAXN = 505;
const int INF = 1000000000;
struct Edge {
int to, l, t;
int next;
} edges[1005];
int head[MAXN];
int edgeCnt = 0;
inline void addEdge(int u, int v, int l, int t) {
edges[++edgeCnt].to = v;
edges[edgeCnt].l = l;
edges[edgeCnt].t = t;
edges[edgeCnt].next = head[u];
head[u] = edgeCnt;
}
static int late[MAXN][MAXN];
int main() {
int n = readInt();
int m = readInt();
int q = readInt();
}