Submission #411010

# Submission time Handle Problem Language Result Execution time Memory
411010 2021-05-24T06:11:42 Z 조영욱(#7633) Stray Cat (JOI20_stray) C++17
0 / 100
294 ms 524292 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;

typedef pair<int,int> P;
vector<P> adj[100000];
vector<int> ret;
int depth[100000];

namespace {

void dfs(int v,int prev) {
    for(int i=0;i<adj[v].size();i++) {
        int nt=adj[v][i].first;
        depth[nt]=depth[v]+1;
        ret[adj[v][i].second]=depth[v]%3;
        dfs(nt,v);
    }
}
}

vector<int> Mark(int n,int m,int a,int b,vector<int> u,vector<int> v) {
    for(int i=0;i<m;i++) {
        adj[u[i]].push_back(P(v[i],i));
        adj[v[i]].push_back(P(u[i],i));
    }
    ret.resize(m);
    ::dfs(0,-1);
    return ret;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;

void Init(int A, int B) {

}

int Move(vector<int> y) {
    vector<int> vec;
    for(int i=0;i<y.size();i++) {
        if (y[i]!=0) {
            vec.push_back(i);
        }
    }
    if (vec.size()==1) {
        return vec[0];
    }
    if (vec[0]!=1||vec[1]!=1) {
        if (vec[0]==1) {
            return vec[0];
        }
        if (vec[1]==1) {
            return vec[1];
        }
    }
    if ((vec[0]+1)%3==vec[1]) {
        return vec[0];
    }
    else {
        return vec[1];
    }
}

Compilation message

Anthony.cpp: In function 'void {anonymous}::dfs(int, int)':
Anthony.cpp:13:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   13 |     for(int i=0;i<adj[v].size();i++) {
      |                 ~^~~~~~~~~~~~~~

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:11:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for(int i=0;i<y.size();i++) {
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Runtime error 294 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 294 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 290 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 290 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 283 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 293 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 286 ms 524292 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -