제출 #1005069

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
10050692024-06-22 06:56:02onbert길고양이 (JOI20_stray)C++17
0 / 100
24 ms15228 KiB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> Mark(int n, int m, int A, int b, vector<int> U, vector<int> V) {
vector<pair<int,int>> adj[n];
// cout << "test" << endl;
for (int i=0;i<m;i++) adj[U[i]].push_back({V[i], i}), adj[V[i]].push_back({U[i], i});
int a[6] = {1, 0, 1, 0, 0, 1};
int vis[n];
for (int i=0;i<n;i++) vis[i] = -1;
queue<int> Q;
vis[0] = 0;
Q.push(0);
vector<int> ans(m);
while (Q.size() > 0) {
int u = Q.front();
for (auto [v, id]:adj[u]) if (vis[v] == -1) {
if (adj[u].size()<=2) vis[v] = (vis[u]+1)%6;
else vis[v] = a[vis[u]];
ans[id] = a[vis[v]];
Q.push(v);
}
Q.pop();
}
// for (int i:ans) cout << i << " "; cout << endl;
return ans;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...