제출 #1178518

#제출 시각아이디문제언어결과실행 시간메모리
1178518ppmn_6길고양이 (JOI20_stray)C++20
15 / 100
42 ms13896 KiB
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) { vector<vector<int>> graph(N); vector<int> res(M), depth(N); for (int i = 0; i < M; i++) { graph[U[i]].push_back(V[i]); graph[V[i]].push_back(U[i]); } vector<bool> vis(N, 0); queue<pair<int, int>> q; vis[0] = 1; q.push({0, 0}); while (q.size()) { auto [c, d] = q.front(); q.pop(); depth[c] = d; for (auto i : graph[c]) { if (!vis[i]) { q.push({i, d + 1}); vis[i] = 1; } } } for (int i = 0; i < M; i++) { int du = depth[U[i]]; int dv = depth[V[i]]; int m = max(du, dv); if (du == dv) { res[i] = (du + 1) % 3; continue; } res[i] = m % 3; } return res; } /*int main() { int n, m; cin >> n >> m; vector<int> u(m), v(m); for (int i = 0; i < m; i++) { cin >> u[i] >> v[i]; u[i]--; v[i]--; } for (auto i : Mark(n, m, 3, 0, u, v)) { cout << i << " "; } return 0; }*/
#include "Catherine.h" #include <vector> void Init(int A, int B) {} int Move(std::vector<int> y) { if (!y[0] && !y[2]) { return 1; } if (!y[0] && !y[1]) { return 2; } if (!y[1] && !y[2]) { return 0; } if (y[0] && y[1]) { return 0; } if (y[0] && y[2]) { return 2; } if (y[1] && y[2]) { return 1; } }

컴파일 시 표준 에러 (stderr) 메시지

# 2번째 컴파일 단계

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:25:1: warning: control reaches end of non-void function [-Wreturn-type]
   25 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...