Submission #710254

#TimeUsernameProblemLanguageResultExecution timeMemory
710254MinhAnhndStray Cat (JOI20_stray)C++14
15 / 100
54 ms16488 KiB
#include "Anthony.h" #include <vector> #include <bits/stdc++.h> namespace { int FunctionExample(int i, int A) { return i % A; } } // namespace std::vector<int> Mark(int N, int M, int A, int B, std::vector<int> U, std::vector<int> V) { std::vector<int> adj[20001]; int index[20001] = {}; std::vector<int> X(M); std::queue<int> bfs; bfs.push(0); index[0] = 1; for (int i = 0; i < M; ++i) { adj[U[i]].push_back(V[i]); adj[V[i]].push_back(U[i]); } while(!bfs.empty()){ int node = bfs.front(); bfs.pop(); for(auto child:adj[node]){ if(index[child]==0){ index[child] = index[node] + 1; if(index[child]==4) index[child] = 1; bfs.push(child); } } } for (int i = 0; i < M; ++i) { int nodeA = index[U[i]]; int nodeB = index[V[i]]; if(nodeA > nodeB) std::swap(nodeA,nodeB); if((nodeA == 1)&&(nodeB == 2)) X[i] = 0; if((nodeA == 2)&&(nodeB == 3)) X[i] = 1; if((nodeA == 1)&&(nodeB == 3)) X[i] = 2; if((nodeA == 2)&&(nodeB == 2)) X[i] = 1; if((nodeA == 3)&&(nodeB == 3)) X[i] = 2; if((nodeA == 1)&&(nodeB == 1)) X[i] = 0; } return X; }
#include "Catherine.h" #include <vector> namespace { int A, B; int variable_example = 0; } // namespace using namespace std; void Init(int A, int B) { ::A = A; ::B = B; } int Move(std::vector<int> y) { ++variable_example; /*for (int j = 0; j < A; ++j) { if (y[j] != 0) { return j; } }*/ if (y[0]==0){ if (y[1]==0){ return 2; } else return 1; } if (y[1]==0){ if (y[2]==0){ return 0; } else return 2; } if (y[2]==0){ if (y[0]==0){ return 1; } else return 0; } return -1; }

Compilation message (stderr)

Anthony.cpp:7:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
    7 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~
#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...