제출 #961858

#제출 시각아이디문제언어결과실행 시간메모리
961858Sharky길고양이 (JOI20_stray)C++17
15 / 100
45 ms17364 KiB
#include "Anthony.h" #include <bits/stdc++.h> using namespace std; #define pii pair<int, int> #define fi first #define se second #define sz(x) (int)x.size() namespace ivan { const int INF = 1e9; vector<vector<pair<int, int>>> adj; vector<int> dist, c; vector<pair<int, int>> e; queue<int> q; vector<bool> vis; }; using namespace ivan; vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) { vector<int> x(m); adj.resize(n); c.resize(m); dist.assign(n, INF); vis.assign(n, 0); for (int i = 0; i < m; i++) { adj[u[i]].push_back({v[i], i}); adj[v[i]].push_back({u[i], i}); e.push_back({u[i], v[i]}); } dist[0] = 0; q.push(0); while (!q.empty()) { int u = q.front(); q.pop(); for (auto& [v, id] : adj[u]) { if (dist[v] > dist[u] + 1) { dist[v] = dist[u] + 1; q.push(v); } } } for (int i = 0; i < e.size(); i++) c[i] = min(dist[e[i].fi], dist[e[i].se]) % 3; return c; }
#include "Catherine.h" #include <bits/stdc++.h> using namespace std; namespace ivan { int a, b; }; using namespace ivan; void Init(int A, int B) { a = A, b = B; } int Move(vector<int> cnt) { set<int> hv; for (int i = 0; i < a; i++) if (cnt[i]) hv.insert(i); if ((int) hv.size() == 1) return *hv.begin(); if (!hv.count(1)) return 2; if (!hv.count(2)) return 0; if (!hv.count(0)) return 1; }

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

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:45:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   45 |     for (int i = 0; i < e.size(); i++) c[i] = min(dist[e[i].fi], dist[e[i].se]) % 3;
      |                     ~~^~~~~~~~~~

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:16:14: warning: control reaches end of non-void function [-Wreturn-type]
   16 |     set<int> hv;
      |              ^~
#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...