Submission #959650

#TimeUsernameProblemLanguageResultExecution timeMemory
959650andrei_boacaStray Cat (JOI20_stray)C++17
15 / 100
43 ms17360 KiB
#include "Anthony.h" #include <vector> #include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; namespace { int INF=1e9; vector<int> muchii[20005]; vector<pii> g; int dist[20005]; int n,m; void bfs() { for(int i=0;i<n;i++) dist[i]=INF; dist[0]=0; queue<int> coada; coada.push(0); while(!coada.empty()) { int nod=coada.front(); coada.pop(); for(int i:muchii[nod]) if(dist[i]>dist[nod]+1) { dist[i]=dist[nod]+1; coada.push(i); } } } int garbage(int x) { if(x%3==0) return 0; if(x%3==1) return 1; return 2; } vector<int> subtask14() { vector<int> sol; for(int i=0;i<m;i++) { int a=g[i].first,b=g[i].second; if(dist[a]>dist[b]) swap(a,b); int val=garbage(dist[a]); sol.push_back(val); } return sol; } } vector<int> Mark(int N, int M, int A, int B,vector<int> U, vector<int> V) { n=N; m=M; for(int i=0;i<m;i++) { int a=U[i],b=V[i]; muchii[a].push_back(b); muchii[b].push_back(a); g.push_back({a,b}); } bfs(); if(B==0) { vector<int> sol=subtask14(); return sol; } vector<int> emp; return emp; }
#include "Catherine.h" #include <vector> #include <bits/stdc++.h> using namespace std; namespace { bool penal; } void Init(int A, int B) { if(B==0) penal=1; } int Move(vector<int> y) { if(penal) { int cnt=0; for(int i=0;i<3;i++) if(y[i]!=0) cnt++; if(cnt==1) { for(int i=0;i<3;i++) if(y[i]>0) return i; } if(y[0]>0&&y[1]>0) return 0; if(y[0]>0&&y[2]>0) return 2; return 1; } }

Compilation message (stderr)

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:39:1: warning: control reaches end of non-void function [-Wreturn-type]
   39 | }
      | ^
#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...