| Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|---|
| 38905 | dtmm | 【S】T3 | C++ | 无测评数据 | 2 | 386 MS | 18416 KB | 807 | 2025-11-19 18:59:34 |
#include<bits/stdc++.h> using namespace std; const int N=3e5+10; int n,m; vector<int>e[N]; int main() { //freopen("nolife.in","r",stdin); //freopen("nolife.out","w",stdout); cin>>n>>m; for(int i=1;i<=m;i++) { int x,y; cin>>x>>y; e[x].push_back(y); e[y].push_back(x); } if(m==n-1) { for(int i=1;i<=n;i++) { cout<<i%3+1<<" "; } } else { for(int i=1;i<=n;i++) { if(i==1) { cout<<1<<" "; } else if(i==(n/3)*2+1) { cout<<2<<" "; } else { cout<<3<<" "; } } } return 0; }