HDU 3062 (2-sat), hdu2-sat
HDU 3062 Party
Question Link
2sat template questions
Code:
#include <cstdio>#include <cstring>#include <cstdlib>#include <vector>#include <algorithm>using namespace std;const int MAXNODE = 2005;struct TwoSet {int n;vector<int> g[MAXNODE * 2];bool mark[MAXNODE * 2];int S[MAXNODE * 2], sn;void init(int tot) {n = tot * 2;for (int i = 0; i < n; i += 2) {g[i].clear();g[i^1].clear();}memset(mark, false, sizeof(mark));}void add_Edge(int u, int uval, int v, int vval) {u = u * 2 + uval;v = v * 2 + vval;g[u^1].push_back(v);g[v^1].push_back(u);}void delete_Edge(int u, int uval, int v, int vval) {u = u * 2 + uval;v = v * 2 + vval;g[u^1].pop_back();g[v^1].pop_back();}bool dfs(int u) {if (mark[u^1]) return false;if (mark[u]) return true;mark[u] = true;S[sn++] = u;for (int i = 0; i < g[u].size(); i++) {int v = g[u][i];if (!dfs(v)) return false;}return true;}bool solve() {for (int i = 0; i < n; i += 2) {if (!mark[i] && !mark[i + 1]) {sn = 0;if (!dfs(i)){for (int j = 0; j < sn; j++)mark[S[j]] = false;sn = 0;if (!dfs(i + 1)) return false;}}}return true;}} gao;int n, m;int main() {while (~scanf("%d", &n)) {gao.init(n);scanf("%d", &m);int u, v, a, b;while (m--) {scanf("%d%d%d%d", &u, &v, &a, &b);gao.add_Edge(u, a, v, b);}printf("%s\n", gao.solve() ? "YES" : "NO");}return 0;}
Xia Mu friends account 2 OP long shot party (Full Version)
Xia Mu's friend account 2OP -- zookeeper daily
Singing: LONG SHOT PARTY
Move forward to the Development Environment 〗
Hashsiri dase mae muite
Why? Use a frozen hand to paint the sky 〗
Kajikamu tede sorani kaita
Jun, the future, the blessing, the lawn lamp, the lawn lamp for your future 〗
Kimino miraini shukufukuno akari tomosu
Cutting the road with your hands 〗
Kiri hirake sono tede
What is the cause? Then, can you hear this?
Kikoe terukai? Kono Kohei
Smile and smile 〗
Sunaoni waraeru koto dakishime
Today, let's take a look 〗
Ima hashsiri dase
The first tip is the tip of the slightly mature color 〗
Sukoshi dake otonano ironi simaru yubisaki
As shown in the following figure, I was very shy and kept away 〗
Tereku sasouni sow.kakushite
You can see your eyes first 〗
Hootsue tsuita kimi mitsumeteru shisenno sakini
Xiao Xiaolei, Xiao Xiaoxiao 〗
Chiisana tsubomiga yurayura
Why 〗
Nee
The servant is always confused 」〗
Boku nante zutto "mayoi" bakaride
Today, I am giving a speech to the speaker, and I think of the words that I said to you that day 〗
Anohi okutta kotoba ima sara omoi dasu
Move forward to the Development Environment 〗
Hashsiri dase mae muite
Why? Use a frozen hand to paint the sky 〗
Kajikamu tede sorani kaita
Jun, the future, the blessing, the lawn lamp, the lawn lamp for your future 〗
Kimino miraini shukufukuno akarito tomosu
Cutting the road with your hands 〗
Kiri hirake sono tede
What is the cause? Then, can you hear this?
Kikoe terukai? Kono Kohei
Smile and smile 〗
Sunaoni waraeru koto dakishime
Today, let's take a look 〗
Ima hashsiri dase
「 かっ」「 て」 what 「 」〗
「 Makashiwa yokatta 」 nante
Please refer to them as follows 〗
Ii takuwa nainda keredo
"I want to trace" back to "Memories "〗
Tori kaeshitai "omoi" mo arunda
The servant squashed his back and squashed his eyes. "servant" said. You pushed my back and put the "I" that was full of sight "〗
Bokuno senakawo osu minagiru shisenno "boku" wo
Bud blowing bud and Bud re-identification 〗
Mebuita tsubomini kasanete
The more time it passes, the more time it passes 〗
Tokiwo koete mata itsuka
「あの」
Corpse Party 2 (Cortana party2)
Visual Testing of this game is made by VA or Woi.