# 神奇

@Wakelin 2018-10-22 11:18 回复

80分代码：

#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <ctime>
#include <cctype>
#include <iostream>
#include <map>
#include <queue>
#include <vector>
#include <algorithm>
using namespace std;

const int MAXN = 20010;
int T, n, p;
int vis[MAXN], f[MAXN];

struct Edge {
int to, nxt, val;
}e[MAXN << 2];

template <typename _Tp>
char ch = getchar( ); bool f = 0; x = 0;
while (!isdigit(ch)) { if (ch == '-') f = 1; ch = getchar( ); }
while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar( );
x = f ? -x : x;
}

inline void AddEdge(int x, int y) {
}

void Clear( ) {
memset(f, 0, sizeof(f));
memset(e, 0, sizeof(e));
memset(vis, 0, sizeof(vis));
tot = 0;
}

bool Dfs(int x, int t) {
for (int i = head[x], v; ~i; i = e[i].nxt) {
v = e[i].to;
if (vis[v] ^ t) {
vis[v] = t;
if (!f[v] || Dfs(f[v], t)) {
f[v] = x;
return true;
}
}
} return false;
}

int main() {
while (T -- ) {
Clear( );
int x, m;
for (int i = 1; i <= p; ++ i) {
for (int i = 1; i <= m; ++ i) {
}
}
if (p > n) {
printf("NO\n");
continue;
}
int ans = 0;
for (int i = 1; i <= p; ++ i)
if (Dfs(i, i)) ans ++;
if (ans == p) printf("YES\n");
else printf("NO\n");
}
return 0;
}

    for (int i = 1; i <= p; ++ i) {
for (int i = 1; i <= m; ++ i) {
// => for (int j = 1; j <= m; ++ j) {
}
}

@RiverFun 2018-10-22 11:31 回复 举报