Submission #939058

# Submission time Handle Problem Language Result Execution time Memory
939058 2024-03-06T04:48:34 Z guagua0407 Stray Cat (JOI20_stray) C++17
4 / 100
35 ms 20092 KB
#include "Anthony.h"
#include <vector>
#include<bits/stdc++.h>

namespace {

using namespace std;
#define f first
#define s second
int A,B;
const int mxn=2e4+5;
vector<pair<int,int>> adj[mxn];
vector<int> ans;
bool visited[mxn];

void dfs(int v,int c=2){
    visited[v]=true;
    for(auto u:adj[v]){
        if(visited[u.f]) continue;
        ans[u.s]=(c+1)%A;
        dfs(u.f,ans[u.s]);
    }
}

}  // namespace

std::vector<int> Mark(int N, int M, int A, int B,std::vector<int> U, std::vector<int> V) {
    ::A = A;
    ::B = B;
    ans.resize(M);
    for(int i=0;i<M;i++){
        adj[U[i]].push_back({V[i],i});
        adj[V[i]].push_back({U[i],i});
    }
    dfs(0);
    return ans;
}
#include "Catherine.h"
#include <vector>
#include<bits/stdc++.h>
namespace {
using namespace std;
int A, B;
int variable_example = 0;

}  // namespace

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

int Move(std::vector<int> y) {
    vector<int> pos;
    for(int i=0;i<(int)y.size();i++){
        if(y[i]>0) pos.push_back(i);
    }
    if((int)pos.size()==1) return pos[0];
    else{
        if((pos[0]+1)%A==pos[1]) return pos[0];
        else return pos[1];
    }
}

Compilation message

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 28 ms 16252 KB Output is correct
2 Correct 1 ms 1304 KB Output is correct
3 Correct 26 ms 14960 KB Output is correct
4 Correct 34 ms 17468 KB Output is correct
5 Correct 33 ms 17532 KB Output is correct
6 Correct 34 ms 15564 KB Output is correct
7 Correct 26 ms 15740 KB Output is correct
8 Correct 32 ms 16764 KB Output is correct
9 Correct 32 ms 16704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 16252 KB Output is correct
2 Correct 1 ms 1304 KB Output is correct
3 Correct 26 ms 14960 KB Output is correct
4 Correct 34 ms 17468 KB Output is correct
5 Correct 33 ms 17532 KB Output is correct
6 Correct 34 ms 15564 KB Output is correct
7 Correct 26 ms 15740 KB Output is correct
8 Correct 32 ms 16764 KB Output is correct
9 Correct 32 ms 16704 KB Output is correct
10 Incorrect 26 ms 13576 KB Wrong Answer [6]
11 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13604 KB Output is correct
2 Correct 1 ms 1308 KB Output is correct
3 Correct 22 ms 12672 KB Output is correct
4 Correct 33 ms 15512 KB Output is correct
5 Correct 31 ms 15480 KB Output is correct
6 Correct 26 ms 13412 KB Output is correct
7 Correct 31 ms 13432 KB Output is correct
8 Correct 28 ms 14444 KB Output is correct
9 Correct 28 ms 14480 KB Output is correct
10 Correct 27 ms 14132 KB Output is correct
11 Correct 27 ms 14196 KB Output is correct
12 Correct 28 ms 14200 KB Output is correct
13 Correct 35 ms 14136 KB Output is correct
14 Correct 28 ms 14460 KB Output is correct
15 Correct 30 ms 14464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 13604 KB Output is correct
2 Correct 1 ms 1308 KB Output is correct
3 Correct 22 ms 12672 KB Output is correct
4 Correct 33 ms 15512 KB Output is correct
5 Correct 31 ms 15480 KB Output is correct
6 Correct 26 ms 13412 KB Output is correct
7 Correct 31 ms 13432 KB Output is correct
8 Correct 28 ms 14444 KB Output is correct
9 Correct 28 ms 14480 KB Output is correct
10 Correct 27 ms 14132 KB Output is correct
11 Correct 27 ms 14196 KB Output is correct
12 Correct 28 ms 14200 KB Output is correct
13 Correct 35 ms 14136 KB Output is correct
14 Correct 28 ms 14460 KB Output is correct
15 Correct 30 ms 14464 KB Output is correct
16 Incorrect 22 ms 11640 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 1808 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 26 ms 20092 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 26 ms 20084 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -