제출 #212442

#제출 시각아이디문제언어결과실행 시간메모리
212442Sweetlemon길고양이 (JOI20_stray)C++14
0 / 100
103 ms16360 KiB
#include "Anthony.h" #include <vector> #include <algorithm> using namespace std; namespace { const int MAXN=20005; const int INF=19260817; vector<int> g[MAXN]; int dep[MAXN],par[MAXN],col[MAXN],stat[MAXN]; const int arr[]={0,0,1,0,1,1}; void dfs(int x){ stat[x]=stat[par[x]]+1,(stat[x]==6)?(stat[x]=0):(0); col[x]=arr[stat[x]]; if (g[x].size()>2) stat[x]=(col[x])?(0):(1); for (auto v:g[x]){ if (v==par[x]) continue; dep[v]=dep[x]+1,par[v]=x; dfs(v); } } } // namespace vector<int> Mark(int n,int m,int a,int b,vector<int> U,vector<int> V){ for (int i=0;i<m;i++){ g[U[i]].push_back(V[i]); g[V[i]].push_back(U[i]); } dfs(0); vector<int> anss; for (int i=0;i<m;i++){ int ncol; int u=U[i]; int v=V[i]; if (u==par[v]) ncol=col[v]; if (v==par[u]) ncol=col[u]; anss.push_back(ncol); } return anss; }
#include "Catherine.h" #include <vector> using namespace std; namespace { int a,b; int moves; int lstmv; int detecting; const int arr[]={0,0,1,0,1,1}; int detect_val=0; } // namespace void Init(int A,int B){ a=A; b=B; moves=0; lstmv=-1; detecting=0; } int Move(vector<int> y) { int hscnt=0; for (int i=0;i<a;i++){ hscnt+=y[i]; } if (!moves){ moves++; if (hscnt>2){ detecting=39; return (lstmv=(y[1]<y[0])); } if (hscnt==1){ detecting=39; return (lstmv=(!(!y[1]))); } detecting=1; if (y[0]==2) lstmv=0,detect_val=0; else if (y[0]==1) lstmv=0,detect_val=2; else lstmv=1,detect_val=3; return lstmv; } moves++; if (detecting<3){ detecting++; if (!hscnt){ detecting=39; return -1; } if (hscnt+1>2){ detecting=39; y[lstmv]++; if (y[0]>y[1]){ lstmv=1; return (lstmv==1)?(-1):(1); } lstmv=0; return (lstmv==0)?(-1):(0); } (y[0])?(lstmv=0):(lstmv=1); detect_val=detect_val*2+lstmv; return lstmv; } if (detecting==3){ detecting=39; if (!hscnt) return -1; if (hscnt+1>2){ y[lstmv]++; if (y[0]>y[1]){ lstmv=1; return (lstmv==1)?(-1):(1); } lstmv=0; return (lstmv==0)?(-1):(0); } if (detect_val==5 || detect_val==18 || detect_val==25 || detect_val==11 || detect_val==22 || detect_val==12) return -1; (y[0])?(lstmv=0):(lstmv=1); return lstmv; } if (!hscnt) return -1; if (hscnt==1){ (y[0])?(lstmv=0):(lstmv=1); return lstmv; } y[lstmv]++; lstmv=(y[0]>y[1]); return lstmv; }
#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...