Submission #72114

#TimeUsernameProblemLanguageResultExecution timeMemory
72114BOOM Tetris for Jeff (#118)Chocolate Cookie Machine (FXCUP3_chocolate)C++17
28 / 100
608 ms25872 KiB
#include <iostream> #include <cstdio> #include <cstdlib> #include <cmath> #include <cstring> #include <string> #include <fstream> #include <sstream> #include <algorithm> #include <functional> #include <set> #include <map> #include <vector> #include <queue> #include <stack> #include <deque> #include <iterator> #include <unordered_set> #include <unordered_map> #include <assert.h> using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> pii; const int MX = 1147483646; const ll MX2 = 3223372036854775800; const int MOD = 1000000007; int main() { cin.tie(NULL); cout.tie(0); ios::sync_with_stdio(false); int n, m, k; cin >> n >> m >> k; int i, j, x; int isL[30011] = {}, cnt1 = 0; int isnL[30011] = {}; set<int> outx; vi comb[30011]; for (i = 1; i <= m; i++) { cin >> x; outx.insert(x); } int a, b; for (i = 1; i <= k; i++) { cin >> a >> b; if (outx.find(a) != outx.end()) continue; if (outx.find(b) != outx.end()) continue; comb[a].push_back(b); comb[b].push_back(a); } int e; cin >> e; string str; bool f1 = 0, f2 = 0; for (i = 1; i <= e; i++) { cin.ignore(5); cin >> x >> str >> str; if (str == "BOOM") { if (outx.find(x) != outx.end()) continue; if (comb[x].empty()) { //�̰ŵ� ó��ó�� if (f1) continue; f1 = 1; for (int sx : outx) isL[sx]++; cnt1++; } else { for (int sx : comb[x]) isL[sx]++; cnt1++; } } else //ok okó���϶� ó���ѹ� { if (!f2) { f2 = 1; for (int sx : outx) isnL[sx]++; } if (comb[x].empty()) continue; for (int sx : comb[x]) isnL[sx]++; } } vi ans; for (i = 1; i <= n; i++) { if (isL[i] == cnt1 && (!isnL[i])) ans.push_back(i); } cout << ans.size() << "\n"; for (int sx : ans) cout << sx << " "; return 0; }

Compilation message (stderr)

chocolate.cpp: In function 'int main()':
chocolate.cpp:39:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j, x;
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...