Submission #1081373

# Submission time Handle Problem Language Result Execution time Memory
1081373 2024-08-30T02:17:57 Z kwongweng Stray Cat (JOI20_stray) C++17
15 / 100
43 ms 17212 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define FOR(i,a,b) for(int i = a; i < b; i++)
#define ROF(i,a,b) for(int i = a; i >=b; i--)
#define pb push_back
#define ms memset
#define fi first
#define se second


namespace {

int FunctionExample(int i, int A) {
  return i % A;
}

}  // namespace

vi Mark(int n, int m, int a, int b, vi U, vi V) {
  vi x(m); FOR(i,0,m) x[i]=-1;
  vii g[n]; 
  FOR(i,0,m){
    g[U[i]].pb({V[i],i}); g[V[i]].pb({U[i],i});
  }
  vi used(n), dist(n);
  vi bfs; bfs.pb(0); used[0]=1;
  FOR(i,0,bfs.size()){
    int u = bfs[i];
    for (ii e : g[u]){
      int v = e.fi;
      if (used[v]) continue;
      dist[v] = dist[u]+1; used[v]=1; bfs.pb(v);
    }
  }
  FOR(i,0,m){
    x[i] = (min(dist[U[i]], dist[V[i]])+1) % 3;
  }
  return x;
}
#include "Catherine.h"
#include <vector>
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
#define FOR(i,a,b) for(int i = a; i < b; i++)
#define ROF(i,a,b) for(int i = a; i >=b; i--)
#define pb push_back
#define ms memset
#define fi first
#define se second

namespace {

int A, B;
int variable_example = 0;

}  // namespace

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

int Move(vi y) {
  if (y[0]+y[1]+y[2] == max(max(y[0],y[1]),y[2])){
    FOR(i,0,3){
      if (y[i] != 0) return i;
    }
  }
  FOR(i,0,3){
    if (y[i]==0){
      return (i+1)%3;
    }
  }
  return -1;
}

Compilation message

Anthony.cpp: In function 'vi Mark(int, int, int, int, vi, vi)':
Anthony.cpp:7:37: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    7 | #define FOR(i,a,b) for(int i = a; i < b; i++)
......
   31 |   FOR(i,0,bfs.size()){
      |       ~~~~~~~~~~~~~~                 
Anthony.cpp:31:3: note: in expansion of macro 'FOR'
   31 |   FOR(i,0,bfs.size()){
      |   ^~~
Anthony.cpp: At global scope:
Anthony.cpp:17:5: warning: 'int {anonymous}::FunctionExample(int, int)' defined but not used [-Wunused-function]
   17 | int FunctionExample(int i, int A) {
      |     ^~~~~~~~~~~~~~~

Catherine.cpp:18:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   18 | int variable_example = 0;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 27 ms 16364 KB Output is correct
2 Correct 0 ms 780 KB Output is correct
3 Correct 27 ms 15288 KB Output is correct
4 Correct 33 ms 17212 KB Output is correct
5 Correct 33 ms 17084 KB Output is correct
6 Correct 30 ms 16056 KB Output is correct
7 Correct 30 ms 16092 KB Output is correct
8 Correct 32 ms 16916 KB Output is correct
9 Correct 28 ms 16896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 16364 KB Output is correct
2 Correct 0 ms 780 KB Output is correct
3 Correct 27 ms 15288 KB Output is correct
4 Correct 33 ms 17212 KB Output is correct
5 Correct 33 ms 17084 KB Output is correct
6 Correct 30 ms 16056 KB Output is correct
7 Correct 30 ms 16092 KB Output is correct
8 Correct 32 ms 16916 KB Output is correct
9 Correct 28 ms 16896 KB Output is correct
10 Correct 24 ms 14084 KB Output is correct
11 Correct 25 ms 13824 KB Output is correct
12 Correct 25 ms 14056 KB Output is correct
13 Correct 24 ms 14100 KB Output is correct
14 Correct 24 ms 14232 KB Output is correct
15 Correct 26 ms 14640 KB Output is correct
16 Correct 30 ms 16620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 13832 KB Output is correct
2 Correct 1 ms 796 KB Output is correct
3 Correct 24 ms 12980 KB Output is correct
4 Correct 38 ms 15116 KB Output is correct
5 Correct 35 ms 15112 KB Output is correct
6 Correct 27 ms 13840 KB Output is correct
7 Correct 26 ms 13832 KB Output is correct
8 Correct 31 ms 14604 KB Output is correct
9 Correct 28 ms 14596 KB Output is correct
10 Correct 27 ms 14232 KB Output is correct
11 Correct 26 ms 14444 KB Output is correct
12 Correct 31 ms 14340 KB Output is correct
13 Correct 32 ms 14336 KB Output is correct
14 Correct 36 ms 14688 KB Output is correct
15 Correct 31 ms 14588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 13832 KB Output is correct
2 Correct 1 ms 796 KB Output is correct
3 Correct 24 ms 12980 KB Output is correct
4 Correct 38 ms 15116 KB Output is correct
5 Correct 35 ms 15112 KB Output is correct
6 Correct 27 ms 13840 KB Output is correct
7 Correct 26 ms 13832 KB Output is correct
8 Correct 31 ms 14604 KB Output is correct
9 Correct 28 ms 14596 KB Output is correct
10 Correct 27 ms 14232 KB Output is correct
11 Correct 26 ms 14444 KB Output is correct
12 Correct 31 ms 14340 KB Output is correct
13 Correct 32 ms 14336 KB Output is correct
14 Correct 36 ms 14688 KB Output is correct
15 Correct 31 ms 14588 KB Output is correct
16 Correct 25 ms 12028 KB Output is correct
17 Correct 25 ms 12028 KB Output is correct
18 Correct 27 ms 12048 KB Output is correct
19 Correct 43 ms 11948 KB Output is correct
20 Correct 26 ms 12748 KB Output is correct
21 Correct 30 ms 12516 KB Output is correct
22 Correct 26 ms 14656 KB Output is correct
23 Correct 30 ms 12252 KB Output is correct
24 Correct 33 ms 12232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 880 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 3312 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 3052 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -