제출 #674331

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6743312022-12-23 17:39:25null_awe길고양이 (JOI20_stray)C++14
100 / 100
51 ms16144 KiB
#include "Anthony.h"
#include <iostream>
#include <set>
#include <vector>
#include <queue>
#include <assert.h>
using namespace std;
#define pii pair<int, int>
vector<int> Mark(int n, int m, int a, int b, vector<int> u, vector<int> v) {
vector<vector<pii>> adj(n);
for (int i = 0; i < m; ++i) adj[u[i]].push_back({v[i], i}), adj[v[i]].push_back({u[i], i});
if (a == 2) {
vector<int> color(m, -1), dist(n, -1), lp(n), llp(n);
for (int i = 0; i < n; ++i) lp[i] = i, llp[i] = i;
queue<int> q; q.push(0), dist[0] = 0;
set<int> heads;
while (q.size()) {
int v = q.front(); q.pop();
int label = dist[v] % 2;
for (const auto& [u, i] : adj[v]) {
if (color[i] >= 0) {
if (adj[v].size() == 2) {
lp[v] = lp[u];
if (lp[u] == u) heads.insert(v);
else llp[v] = llp[u];
}
continue;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, std::vector<int>, std::vector<int>)':
Anthony.cpp:22:24: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   22 |       for (const auto& [u, i] : adj[v]) {
      |                        ^
Anthony.cpp:41:26: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   41 |         for (const auto& [u, i] : adj[cur]) {
      |                          ^
Anthony.cpp:46:33: warning: unused variable 'v2' [-Wunused-variable]
   46 |       int v1 = dist[lp[p]] % 2, v2 = dist[cur] % 2;
      |                                 ^~
Anthony.cpp:61:24: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   61 |       for (const auto& [u, i] : adj[v]) {
      |                        ^
Anthony.cpp:76:22: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   76 |     for (const auto& [u, i] : adj[v]) {
      |                      ^

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:31:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |   for (int i = 0; i < copy.size(); ++i)
      |                   ~~^~~~~~~~~~~~~
Catherine.cpp:38:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |       for (int i = 0; i < y.size(); ++i) {
      |                       ~~^~~~~~~~~~
Catherine.cpp:55:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |         if (sum == 0 || sum == y.size()) {
      |                         ~~~~^~~~~~~~~~~
Catherine.cpp:61:29: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   61 |           for (int i = 0; i < y.size(); ++i) {
      |                           ~~^~~~~~~~~~
Catherine.cpp:71:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   71 |         for (int i = 0; i < y.size(); ++i) {
      |                         ~~^~~~~~~~~~
Catherine.cpp:102:46: warning: comparison of integer expressions of different signedness: 'const int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  102 |   if (max(count[0], max(count[1], count[2])) == y.size()) return y[0];
      |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
#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...