Submission #829620

#TimeUsernameProblemLanguageResultExecution timeMemory
829620NemanjaSo2005Stray Cat (JOI20_stray)C++17
15 / 100
44 ms16648 KiB
#include "Anthony.h" #include <bits/stdc++.h> #define ll long long using namespace std; vector<int> graf[20005]; int dist[20005]; queue<int> Q; int N; bool prosli[20005]; void BFS(int gde){ for(int i=0;i<=N;i++) dist[i]=-1; dist[gde]=0; Q.push(gde); while(Q.size()){ int tren=Q.front(); Q.pop(); if(prosli[tren]) continue; //cout<<tren<<endl; prosli[tren]=true; for(int i=0;i<graf[tren].size();i++) if(dist[graf[tren][i]]==-1){ dist[graf[tren][i]]=dist[tren]+1; Q.push(graf[tren][i]); } } return; } vector<int> Mark(int n, int M, int A, int B, vector<int> U,vector<int> V) { N=n; for(int i=0;i<M;i++){ graf[U[i]].push_back(V[i]); graf[V[i]].push_back(U[i]); } BFS(0); /*for(int i=0;i<N;i++) cout<<dist[i]<<" "; cout<<endl;*/ if(B>=6 and M==N-1){ string S="001011"; vector<int> R; for(int i=0;i<M;i++){ int md=min(dist[U[i]],dist[V[i]]); R.push_back(S[md%6]-'0'); } return R; } string S="012"; vector<int> R; for(int i=0;i<M;i++){ int md=min(dist[U[i]],dist[V[i]]); R.push_back(S[md%3]-'0'); } return R; }
#include "Catherine.h" #include<bits/stdc++.h> #define ll long long using namespace std; int slucaj; void Init(int A, int B) { if(A==2) slucaj=2; else slucaj=1; } int Move(std::vector<int> y) { if(slucaj==1){ if(y[0]==0 and y[1]==0) return 2; if(y[0]==0 and y[2]==0) return 1; if(y[1]==0 and y[2]==0) return 0; if(y[0]==0) return 1; if(y[1]==0) return 2; return 0; } exit(-1); }

Compilation message (stderr)

Anthony.cpp: In function 'void BFS(int)':
Anthony.cpp:22:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   22 |       for(int i=0;i<graf[tren].size();i++)
      |                   ~^~~~~~~~~~~~~~~~~~
#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...