QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#397598 | #141. 8 染色 | Network_Error | 0 | 20ms | 22908kb | C++14 | 1.6kb | 2024-04-24 14:16:04 | 2024-04-24 14:16:05 |
Judging History
Alice
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
//#define int long long
vector<int> Alice(int n,int m,vector<int> u,vector<int> v,vector<int> c){
vector<int> ans(0);
static int deg[200010];
for(int i=0;i<m;i++)deg[u[i]]++,deg[v[i]]++;
for(int i=0;i<n;i++){
if(deg[i]<8)continue;
int o=min(c[i],7-c[i]);
ans.pb(o&1);ans.pb(o>>1);}return ans;
}
Bob
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define piii tuple<int,int,int>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define deb(var) cerr<<#var<<'='<<(var)<<"; "
//#define int long long
vector<int> g[200010];
int ans[200010],vis[200010];
void dfs(int u){
vis[u]=1;
for(auto v:g[u]){
if(ans[v]!=-1&&!vis[v]
&&min(ans[v],7-ans[v])==min(ans[u],7-ans[u])){
ans[v]=7-ans[u];dfs(v);
}
}
}
vector<int> Bob(int n,int m,vector<int> u,vector<int> v,vector<int> x){
for(int i=0;i<m;i++)g[u[i]].pb(v[i]),g[v[i]].pb(u[i]);
for(int i=0,tot=0;i<n;i++){
ans[i]=-1;
if(g[i].size()<8)continue;
ans[i]=x[tot++];ans[i]|=x[tot++]<<1;
}
for(int i=0;i<n;i++)
if(!vis[i]&&~ans[i])dfs(i);
for(int i=0;i<n;i++){
if(ans[i]==-1){
int buc[8]={0,0,0,0,0,0,0,0};
for(auto v:g[i])
if(~ans[v])buc[ans[v]]=1;
for(int x=0;x<8;x++)if(!buc[x])ans[i]=x;
}
}
return vector<int>(ans+1,ans+n+1);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 20ms
memory: 22908kb
input:
10000 500000 5247 482 4774 3796 5245 9386 8794 2818 1911 3240 6925 6008 6313 1737 8668 4913 7892 5444 6740 2271 2100 53 8527 9605 4009 4765 5293 2683 6552 1326 8877 9929 402 9849 8664 6893 1998 7305 155 9477 9753 8036 448 5438 8535 3111 9493 406 7694 2030 5745 6890 5519 3106 8979 5098 9948 2453 5601...
output:
Success +110000101111101110100101110010011110001011101000000111100110010111000101001010111000110000110100000101011101110000011000101000110111101101110011111111111001110011111110101001001110001111101001010000011110000011010111111000100110010001110100001010100110100101110111001010110011001111111000100...
input:
10000 500000 5247 482 4774 3796 5245 9386 8794 2818 1911 3240 6925 6008 6313 1737 8668 4913 7892 5444 6740 2271 2100 53 8527 9605 4009 4765 5293 2683 6552 1326 8877 9929 402 9849 8664 6893 1998 7305 155 9477 9753 8036 448 5438 8535 3111 9493 406 7694 2030 5745 6890 5519 3106 8979 5098 9948 2453 5601...
output:
Success 0 0 1 4 3 6 4 6 6 2 2 3 0 6 2 4 6 7 6 4 6 1 7 0 5 3 6 2 6 5 2 3 0 2 2 7 6 6 4 1 7 3 7 7 3 2 7 0 2 5 5 4 5 3 0 7 5 1 0 1 6 7 4 2 3 6 4 2 4 7 3 3 3 3 3 1 2 3 0 3 4 4 1 6 1 5 7 3 1 0 4 4 6 6 2 5 0 0 2 3 1 0 7 3 2 2 4 3 6 7 6 5 1 2 7 5 4 5 7 7 6 6 1 5 6 1 5 2 3 2 4 0 6 1 4 7 4 0 4 3 4 6 7 1 7 2 ...
result:
wrong answer the color of the vertex 2100 and 53 is the same