版本比较
[建模] [二分图] [贪心] [ARC080F] Prime Flip | noip模拟赛 疯癫兄弟
正文
增加 4 行删除 4 行
33 行未改动3435363738383940414224 行未改动6768697071717273747514 行未改动909192939494959697989910010110210310410410533 行未改动```cpp#include<bits/stdc++.h>using namespace std;
const int N = 2e3 + 5, M = 1e6 + 2e3 + 5, C = 1e7, inf = 1e9; const int N = 2e3 + 5, M = 1e6 + 2e3 + 5, C = 1e7, inf = 1e9;int k, n, x, a[N], s, t, L, R;int head[N], now[N], tot = 1;int dep[N], ans;bool yfz[C + 5];24 行未改动 if(!k) dep[v] = inf; e[i].w -= k, e[i ^ 1].w += k; sum -= k, res += k; } return res; return res;}inline bool check(int p){ if(p <= 2 || p % 2 == 0) return false; for(int i = 2; i * i <= p;++i)14 行未改动 else add(j, i, 1), add(i, j, 0); }}inline void solve(){ while(bfs()) ans += dfs(s, inf); while(bfs()) ans += dfs(s, inf); int pipei = ans; ans += (L - pipei) / 2 * 2 + (R - pipei) / 2 * 2; if((L - pipei) & 1) ans += 3;}signed main(){ build(); solve(); cout << ans; return 0;} }```