답안 #1061492

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1061492 2024-08-16T09:55:56 Z Hanksburger 길고양이 (JOI20_stray) C++17
15 / 100
44 ms 17316 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> adj[20005];
int d[20005];
queue<int> q;
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(V[i]);
    adj[V[i]].push_back(U[i]);
  }
  d[0]=1;
  q.push(0);
  while (!q.empty())
  {
    int u=q.front();
    q.pop();
    for (int v:adj[u])
    {
      if (!d[v])
      {
        d[v]=d[u]+1;
        q.push(v);
      }
    }
  }
  vector<int> ans;
  for (int i=0; i<M; i++)
  {
    int x=min(d[U[i]], d[V[i]]);
    if (A>2)
        ans.push_back(x%3);
    else
        ans.push_back(x%6==0 || x%6==1 || x%6==4);
  }
  return ans;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
int a;
void Init(int A, int B)
{
    a=A;
}
int Move(vector<int> y)
{
    if (a>=3)
    {
        if (y[0] && !y[2])
            return 0;
        else if (y[1] && !y[0])
            return 1;
        else
            return 2;
    }
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
   20 | }
      | ^
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 16184 KB Output is correct
2 Correct 0 ms 1300 KB Output is correct
3 Correct 37 ms 15252 KB Output is correct
4 Correct 34 ms 17212 KB Output is correct
5 Correct 44 ms 17316 KB Output is correct
6 Correct 35 ms 15868 KB Output is correct
7 Correct 29 ms 15916 KB Output is correct
8 Correct 32 ms 16676 KB Output is correct
9 Correct 41 ms 16928 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 16184 KB Output is correct
2 Correct 0 ms 1300 KB Output is correct
3 Correct 37 ms 15252 KB Output is correct
4 Correct 34 ms 17212 KB Output is correct
5 Correct 44 ms 17316 KB Output is correct
6 Correct 35 ms 15868 KB Output is correct
7 Correct 29 ms 15916 KB Output is correct
8 Correct 32 ms 16676 KB Output is correct
9 Correct 41 ms 16928 KB Output is correct
10 Correct 25 ms 14160 KB Output is correct
11 Correct 31 ms 14156 KB Output is correct
12 Correct 25 ms 14328 KB Output is correct
13 Correct 25 ms 14044 KB Output is correct
14 Correct 41 ms 14280 KB Output is correct
15 Correct 27 ms 14416 KB Output is correct
16 Correct 31 ms 16584 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 13656 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 23 ms 13180 KB Output is correct
4 Correct 28 ms 15100 KB Output is correct
5 Correct 29 ms 15184 KB Output is correct
6 Correct 25 ms 13652 KB Output is correct
7 Correct 23 ms 13664 KB Output is correct
8 Correct 27 ms 14424 KB Output is correct
9 Correct 27 ms 14420 KB Output is correct
10 Correct 27 ms 14204 KB Output is correct
11 Correct 30 ms 14076 KB Output is correct
12 Correct 43 ms 14140 KB Output is correct
13 Correct 25 ms 14160 KB Output is correct
14 Correct 33 ms 14424 KB Output is correct
15 Correct 39 ms 14364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 13656 KB Output is correct
2 Correct 1 ms 1312 KB Output is correct
3 Correct 23 ms 13180 KB Output is correct
4 Correct 28 ms 15100 KB Output is correct
5 Correct 29 ms 15184 KB Output is correct
6 Correct 25 ms 13652 KB Output is correct
7 Correct 23 ms 13664 KB Output is correct
8 Correct 27 ms 14424 KB Output is correct
9 Correct 27 ms 14420 KB Output is correct
10 Correct 27 ms 14204 KB Output is correct
11 Correct 30 ms 14076 KB Output is correct
12 Correct 43 ms 14140 KB Output is correct
13 Correct 25 ms 14160 KB Output is correct
14 Correct 33 ms 14424 KB Output is correct
15 Correct 39 ms 14364 KB Output is correct
16 Correct 27 ms 12180 KB Output is correct
17 Correct 23 ms 12112 KB Output is correct
18 Correct 25 ms 11956 KB Output is correct
19 Correct 22 ms 12032 KB Output is correct
20 Correct 30 ms 12548 KB Output is correct
21 Correct 25 ms 12356 KB Output is correct
22 Correct 28 ms 14616 KB Output is correct
23 Correct 32 ms 12116 KB Output is correct
24 Correct 37 ms 12096 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 1572 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 34 ms 11688 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 28 ms 11608 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -