# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
72114 | 2018-08-26T05:21:10 Z | BOOM Tetris for Jeff(#2197, exqt, esselem) | Chocolate Cookie Machine (FXCUP3_chocolate) | C++17 | 608 ms | 25872 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1272 KB | Output is correct |
2 | Correct | 3 ms | 1380 KB | Output is correct |
3 | Correct | 6 ms | 1608 KB | Output is correct |
4 | Correct | 99 ms | 7860 KB | Output is correct |
5 | Correct | 4 ms | 7860 KB | Output is correct |
6 | Correct | 6 ms | 7860 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 608 ms | 25872 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 1272 KB | Output is correct |
2 | Correct | 3 ms | 1380 KB | Output is correct |
3 | Correct | 6 ms | 1608 KB | Output is correct |
4 | Correct | 99 ms | 7860 KB | Output is correct |
5 | Correct | 4 ms | 7860 KB | Output is correct |
6 | Correct | 6 ms | 7860 KB | Output is correct |
7 | Incorrect | 608 ms | 25872 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |