Submission #388308

# Submission time Handle Problem Language Result Execution time Memory
388308 2021-04-10T21:17:56 Z ngrace Stray Cat (JOI20_stray) C++14
6 / 100
60 ms 16560 KB
#include "Anthony.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
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> X(M,-1);

  vector<vector<pair<int,int>>> adj(N,vector<pair<int,int>>(0));//node,index of road
  for(int i=0;i<M;i++){
    adj[U[i]].push_back({V[i],i});
    adj[V[i]].push_back({U[i],i});
  }

  if(A==4 || (A==3 && M==N-1)){
    vector<int> dists(N,-1);
    dists[0]=0;
    queue<int> q;
    q.push(0);

    while(q.size()>0){
      int cur=q.front();
      q.pop();
      for(pair<int,int>& it:adj[cur]){
        if(dists[it.first]==-1){
          dists[it.first]=dists[cur]+1;
          X[it.second]=dists[cur]%3;
          q.push(it.first);
        }
      }
    }

    for(int i=0;i<M;i++){
      if(X[i]==-1){
        X[i]=3;
      }
    }
  }

  return X;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
namespace {

int A, B, out;
int variable_example = 0;
vector<int> cur;
vector<int> pastMoves;

}  // namespace

void Init(int A, int B) {
  ::A = A;
  ::B = B;
}

int Move(std::vector<int> y) {
  out=0;
  cur = vector<int>(4,0);
  if(A==4 || A==3){
    if(pastMoves.size()>0){
      y[pastMoves.back()]++;
    }
    for(int i=0;i<y.size();i++){
      if(y[i]>0){
        cur[i]=1;
      }
    }
    
    if(cur[0]==1 && cur[1]==1){
      out=0;
    }
    else if(cur[1]==1&&cur[2]==1){
      out=1;
    }
    else if(cur[2]==1&&cur[0]==1){
      out=2;
    }
    else if(cur[0]==1){
      out=0;
    }
    else if(cur[1]==1){
      out=1;
    }
    else{
      out=2;
    }
  }
  
  pastMoves.push_back(out);
  return out;
}

Compilation message

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

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:25:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int i=0;i<y.size();i++){
      |                 ~^~~~~~~~~
Catherine.cpp: At global scope:
Catherine.cpp:7:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    7 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 46 ms 15436 KB Output is correct
2 Correct 0 ms 492 KB Output is correct
3 Correct 36 ms 14768 KB Output is correct
4 Correct 59 ms 16504 KB Output is correct
5 Correct 60 ms 16560 KB Output is correct
6 Correct 44 ms 15304 KB Output is correct
7 Correct 51 ms 15216 KB Output is correct
8 Correct 53 ms 15984 KB Output is correct
9 Correct 51 ms 16052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 15436 KB Output is correct
2 Correct 0 ms 492 KB Output is correct
3 Correct 36 ms 14768 KB Output is correct
4 Correct 59 ms 16504 KB Output is correct
5 Correct 60 ms 16560 KB Output is correct
6 Correct 44 ms 15304 KB Output is correct
7 Correct 51 ms 15216 KB Output is correct
8 Correct 53 ms 15984 KB Output is correct
9 Correct 51 ms 16052 KB Output is correct
10 Correct 41 ms 13548 KB Output is correct
11 Correct 40 ms 13440 KB Output is correct
12 Correct 40 ms 13400 KB Output is correct
13 Correct 43 ms 13416 KB Output is correct
14 Correct 43 ms 13712 KB Output is correct
15 Correct 48 ms 14076 KB Output is correct
16 Correct 52 ms 16088 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 13012 KB Output is correct
2 Correct 1 ms 500 KB Output is correct
3 Correct 36 ms 12632 KB Output is correct
4 Correct 53 ms 14312 KB Output is correct
5 Correct 53 ms 14304 KB Output is correct
6 Correct 45 ms 13044 KB Output is correct
7 Correct 44 ms 13156 KB Output is correct
8 Correct 48 ms 13784 KB Output is correct
9 Correct 48 ms 13800 KB Output is correct
10 Correct 44 ms 13596 KB Output is correct
11 Correct 45 ms 13508 KB Output is correct
12 Correct 46 ms 13552 KB Output is correct
13 Correct 49 ms 13516 KB Output is correct
14 Correct 49 ms 13796 KB Output is correct
15 Correct 50 ms 13824 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 46 ms 13012 KB Output is correct
2 Correct 1 ms 500 KB Output is correct
3 Correct 36 ms 12632 KB Output is correct
4 Correct 53 ms 14312 KB Output is correct
5 Correct 53 ms 14304 KB Output is correct
6 Correct 45 ms 13044 KB Output is correct
7 Correct 44 ms 13156 KB Output is correct
8 Correct 48 ms 13784 KB Output is correct
9 Correct 48 ms 13800 KB Output is correct
10 Correct 44 ms 13596 KB Output is correct
11 Correct 45 ms 13508 KB Output is correct
12 Correct 46 ms 13552 KB Output is correct
13 Correct 49 ms 13516 KB Output is correct
14 Correct 49 ms 13796 KB Output is correct
15 Correct 50 ms 13824 KB Output is correct
16 Incorrect 8 ms 2508 KB Wrong Answer [2]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 620 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 2640 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 2636 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -