Submission #829700

# Submission time Handle Problem Language Result Execution time Memory
829700 2023-08-18T14:13:44 Z MODDI Stray Cat (JOI20_stray) C++14
15 / 100
44 ms 16140 KB
#include "Anthony.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace {
}  // namespace
 
std::vector<int> Mark(int N, int M, int A, int B, vector<int> U, vector<int> V) {
 	vi arr(M, -1);
 	vector<vector<pii>> G(N, vector<pii>());
 	for(int i = 0; i < M; i++){
 		int u = U[i], v = V[i];
 		G[u].pb({v, i});
 		G[v].pb({u, i});
	 }
	vi dist(N, N);
	dist[0] = 0;
	queue<int> q;
	q.push(0);
	while(!q.empty()){
		int v = q.front();
		q.pop();
		for(pii next : G[v]){
			if(dist[next.first] == N){
				dist[next.first] = 1 + dist[v];
				q.push(next.first);
			}
		}
	}
	if(A >= 3){
		for(int i = 0; i < M; i++){
			arr[i] = min(dist[U[i]], dist[V[i]]) % 3;
		}
		return arr;
	}
	
	
	return arr;
}
#include "Catherine.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace {
 
int A;
bool bambooPart;
vector<int> colors;
 
bool GoingUp(vector<int> s) {
  vector<int> t = {1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0};
//  reverse(t.begin(), t.end());
  for (int i = 0; i + (int)s.size() <= (int)t.size(); i++) {
    bool ok = true;
    for (int j = 0; j < (int)s.size(); j++)
      ok &= s[j] == t[i + j];
    if (ok) return true;
  }
  return false;
}
 
}  // namespace
 
void Init(int A, int B) {
  ::A = A;
  ::bambooPart = true;
  ::colors = vector<int>();
}
 
int Move(std::vector<int> y) {
  if (::A > 2) {
    int c = 0;
    while(c < 3) {
      if (y[c] > 0 && y[(c + 2) % 3] == 0) break;
      c++;
    }
    assert(c < 3);
    return c;
  } 
 
}

Compilation message

Catherine.cpp: In function 'int Move(std::vector<int>)':
Catherine.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
   48 | }
      | ^
Catherine.cpp: At global scope:
Catherine.cpp:17:6: warning: 'bool {anonymous}::GoingUp(std::vector<int>)' defined but not used [-Wunused-function]
   17 | bool GoingUp(vector<int> s) {
      |      ^~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 27 ms 15032 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 27 ms 14380 KB Output is correct
4 Correct 34 ms 16136 KB Output is correct
5 Correct 44 ms 16140 KB Output is correct
6 Correct 26 ms 14740 KB Output is correct
7 Correct 26 ms 14812 KB Output is correct
8 Correct 33 ms 15476 KB Output is correct
9 Correct 37 ms 15576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 15032 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 27 ms 14380 KB Output is correct
4 Correct 34 ms 16136 KB Output is correct
5 Correct 44 ms 16140 KB Output is correct
6 Correct 26 ms 14740 KB Output is correct
7 Correct 26 ms 14812 KB Output is correct
8 Correct 33 ms 15476 KB Output is correct
9 Correct 37 ms 15576 KB Output is correct
10 Correct 26 ms 12864 KB Output is correct
11 Correct 25 ms 12900 KB Output is correct
12 Correct 28 ms 12812 KB Output is correct
13 Correct 25 ms 12908 KB Output is correct
14 Correct 26 ms 13164 KB Output is correct
15 Correct 27 ms 13420 KB Output is correct
16 Correct 31 ms 15764 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 12660 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 20 ms 12272 KB Output is correct
4 Correct 34 ms 13872 KB Output is correct
5 Correct 34 ms 13956 KB Output is correct
6 Correct 27 ms 12656 KB Output is correct
7 Correct 26 ms 12692 KB Output is correct
8 Correct 30 ms 13232 KB Output is correct
9 Correct 28 ms 13292 KB Output is correct
10 Correct 26 ms 13100 KB Output is correct
11 Correct 26 ms 12988 KB Output is correct
12 Correct 26 ms 13040 KB Output is correct
13 Correct 27 ms 13024 KB Output is correct
14 Correct 28 ms 13260 KB Output is correct
15 Correct 28 ms 13424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 12660 KB Output is correct
2 Correct 0 ms 516 KB Output is correct
3 Correct 20 ms 12272 KB Output is correct
4 Correct 34 ms 13872 KB Output is correct
5 Correct 34 ms 13956 KB Output is correct
6 Correct 27 ms 12656 KB Output is correct
7 Correct 26 ms 12692 KB Output is correct
8 Correct 30 ms 13232 KB Output is correct
9 Correct 28 ms 13292 KB Output is correct
10 Correct 26 ms 13100 KB Output is correct
11 Correct 26 ms 12988 KB Output is correct
12 Correct 26 ms 13040 KB Output is correct
13 Correct 27 ms 13024 KB Output is correct
14 Correct 28 ms 13260 KB Output is correct
15 Correct 28 ms 13424 KB Output is correct
16 Correct 27 ms 11092 KB Output is correct
17 Correct 24 ms 11080 KB Output is correct
18 Correct 24 ms 10984 KB Output is correct
19 Correct 24 ms 10988 KB Output is correct
20 Correct 27 ms 11628 KB Output is correct
21 Correct 25 ms 11368 KB Output is correct
22 Correct 27 ms 13592 KB Output is correct
23 Correct 27 ms 10976 KB Output is correct
24 Correct 34 ms 10964 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 644 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 2312 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 2316 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -