Submission #1097371

# Submission time Handle Problem Language Result Execution time Memory
1097371 2024-10-07T04:36:21 Z thangdz2k7 Stray Cat (JOI20_stray) C++17
15 / 100
36 ms 16752 KB
// author : thembululquaUwU
// 3.9.2024

#include <bits/stdc++.h>
#include "Anthony.h"
#define pb push_back
#define fi first
#define se second
#define endl '\n'

using namespace std;
using ll = long long;
using ii = pair <int, int>;
using vi = vector <int>;

const int MaxN = 2e5;
const int mod = 1e9 + 7;

void maxl(auto &a, auto b) {a = max(a, b);}
void minl(auto &a, auto b) {a = min(a, b);}

vector <int> s = {0, 1, 0, 0, 1, 1};

vector <int> Mark(int n, int m, int a, int b, vi u, vi v){
    vi ans(m);
    vector <vector <ii>> adj(n);
    for (int i = 0; i < m; ++ i){
        adj[u[i]].pb({v[i], i});
        adj[v[i]].pb({u[i], i});
    }
    vi dep(n, 0);

    auto bfs = [&](){
        queue <int> qu; qu.push(0); dep[0] = 1;
        while (qu.size()){
            int u = qu.front(); qu.pop();
            for (auto [v, id] : adj[u]){
                if (!dep[v]) dep[v] = dep[u] + 1, ans[id] = dep[u] % 3, qu.push(v);
                else ans[id] = dep[v] % 3;
            }
        }
    };

    if (a > 2) bfs(); return ans;
}

// author : thembululquaUwU
// 3.9.2024

#include <bits/stdc++.h>
#include "Catherine.h"
#define pb push_back
#define fi first
#define se second
#define endl '\n'

using namespace std;
using ll = long long;
using ii = pair <int, int>;
using vi = vector <int>;

const int MaxN = 2e5;
const int mod = 1e9 + 7;

void maxl(auto &a, auto b) {a = max(a, b);}
void minl(auto &a, auto b) {a = min(a, b);}

int a, b;

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

int Move(vector <int> y){
    if (a > 2){
        if (!y[0] && !y[1]) return 2;
        if (!y[2] && !y[0]) return 1;
        if (!y[2] && !y[1]) return 0;
        if (!y[0]) return 1;
        if (!y[2]) return 0;
        return 2;
    }
}

Compilation message

Anthony.cpp:19:11: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | void maxl(auto &a, auto b) {a = max(a, b);}
      |           ^~~~
Anthony.cpp:19:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | void maxl(auto &a, auto b) {a = max(a, b);}
      |                    ^~~~
Anthony.cpp:20:11: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   20 | void minl(auto &a, auto b) {a = min(a, b);}
      |           ^~~~
Anthony.cpp:20:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   20 | void minl(auto &a, auto b) {a = min(a, b);}
      |                    ^~~~
Anthony.cpp: In function 'std::vector<int> Mark(int, int, int, int, vi, vi)':
Anthony.cpp:44:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   44 |     if (a > 2) bfs(); return ans;
      |     ^~
Anthony.cpp:44:23: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   44 |     if (a > 2) bfs(); return ans;
      |                       ^~~~~~

Catherine.cpp:19:11: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | void maxl(auto &a, auto b) {a = max(a, b);}
      |           ^~~~
Catherine.cpp:19:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   19 | void maxl(auto &a, auto b) {a = max(a, b);}
      |                    ^~~~
Catherine.cpp:20:11: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   20 | void minl(auto &a, auto b) {a = min(a, b);}
      |           ^~~~
Catherine.cpp:20:20: warning: use of 'auto' in parameter declaration only available with '-fconcepts-ts'
   20 | void minl(auto &a, auto b) {a = min(a, b);}
      |                    ^~~~
Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:35:1: warning: control reaches end of non-void function [-Wreturn-type]
   35 | }
      | ^
# Verdict Execution time Memory Grader output
1 Correct 32 ms 15748 KB Output is correct
2 Correct 0 ms 796 KB Output is correct
3 Correct 21 ms 15152 KB Output is correct
4 Correct 32 ms 16744 KB Output is correct
5 Correct 33 ms 16752 KB Output is correct
6 Correct 28 ms 15480 KB Output is correct
7 Correct 26 ms 15472 KB Output is correct
8 Correct 33 ms 16264 KB Output is correct
9 Correct 32 ms 16228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 15748 KB Output is correct
2 Correct 0 ms 796 KB Output is correct
3 Correct 21 ms 15152 KB Output is correct
4 Correct 32 ms 16744 KB Output is correct
5 Correct 33 ms 16752 KB Output is correct
6 Correct 28 ms 15480 KB Output is correct
7 Correct 26 ms 15472 KB Output is correct
8 Correct 33 ms 16264 KB Output is correct
9 Correct 32 ms 16228 KB Output is correct
10 Correct 23 ms 13648 KB Output is correct
11 Correct 27 ms 13636 KB Output is correct
12 Correct 23 ms 13604 KB Output is correct
13 Correct 23 ms 13628 KB Output is correct
14 Correct 24 ms 13920 KB Output is correct
15 Correct 26 ms 14156 KB Output is correct
16 Correct 31 ms 16276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 13188 KB Output is correct
2 Correct 0 ms 796 KB Output is correct
3 Correct 26 ms 12868 KB Output is correct
4 Correct 33 ms 14664 KB Output is correct
5 Correct 31 ms 14680 KB Output is correct
6 Correct 24 ms 13176 KB Output is correct
7 Correct 25 ms 13192 KB Output is correct
8 Correct 27 ms 13988 KB Output is correct
9 Correct 28 ms 13944 KB Output is correct
10 Correct 26 ms 13708 KB Output is correct
11 Correct 26 ms 13696 KB Output is correct
12 Correct 26 ms 13704 KB Output is correct
13 Correct 26 ms 13668 KB Output is correct
14 Correct 28 ms 14084 KB Output is correct
15 Correct 36 ms 13876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 13188 KB Output is correct
2 Correct 0 ms 796 KB Output is correct
3 Correct 26 ms 12868 KB Output is correct
4 Correct 33 ms 14664 KB Output is correct
5 Correct 31 ms 14680 KB Output is correct
6 Correct 24 ms 13176 KB Output is correct
7 Correct 25 ms 13192 KB Output is correct
8 Correct 27 ms 13988 KB Output is correct
9 Correct 28 ms 13944 KB Output is correct
10 Correct 26 ms 13708 KB Output is correct
11 Correct 26 ms 13696 KB Output is correct
12 Correct 26 ms 13704 KB Output is correct
13 Correct 26 ms 13668 KB Output is correct
14 Correct 28 ms 14084 KB Output is correct
15 Correct 36 ms 13876 KB Output is correct
16 Correct 20 ms 11696 KB Output is correct
17 Correct 23 ms 11656 KB Output is correct
18 Correct 24 ms 11568 KB Output is correct
19 Correct 24 ms 11580 KB Output is correct
20 Correct 27 ms 12368 KB Output is correct
21 Correct 25 ms 12108 KB Output is correct
22 Correct 27 ms 13952 KB Output is correct
23 Correct 24 ms 11732 KB Output is correct
24 Correct 28 ms 11840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1040 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 20 ms 10888 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 10892 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -