제출 #203639

#제출 시각아이디문제언어결과실행 시간메모리
203639fedoseevtimofeyCats or Dogs (JOI18_catdog)C++14
0 / 100
6 ms2680 KiB
#include <iostream> #include <string> #include <vector> #include <queue> #include <deque> #include <stack> #include <set> #include <map> #include <unordered_map> #include <unordered_set> #include <cstring> #include <cmath> #include <algorithm> #include <random> #include <complex> #include <iomanip> #include <cassert> #include <functional> using namespace std; typedef long long ll; const int N = 1e5 + 7; vector <int> g[N]; void initialize(int n, vector <int> a, vector <int> b) { for (int i = 0; i + 1 < n; ++i) { --a[i], --b[i]; g[a[i]].push_back(b[i]); g[b[i]].push_back(a[i]); } } int cat(int v) { --v; return 0; } int dog(int v) { --v; return 0; } int neighbor(int v) { --v; return 0; } #ifdef LOCAL int main() { ios_base::sync_with_stdio(false); cin.tie(0); #ifdef LOCAL freopen("input.txt", "r", stdin); #endif int n, q; cin >> n >> q; vector <int> a(n - 1), b(n - 1); for (int i = 0; i + 1 < n; ++i) { cin >> a[i] >> b[i]; } initialize(n, a, b); for (int i = 0; i < q; ++i) { int t, v; cin >> t >> v; if (t == 1) { cout << cat(v) << '\n'; } else if (t == 2) { cout << dog(v) << '\n'; } else { cout << neighbor(v) << '\n'; } } } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...