Submission #565933

# Submission time Handle Problem Language Result Execution time Memory
565933 2022-05-21T14:56:23 Z errorgorn Stray Cat (JOI20_stray) C++17
0 / 100
42 ms 3836 KB
#include "Anthony.h"

#include <bits/stdc++.h>
using namespace std;

#define int long long
#define ii pair<int,int>
#define fi first
#define se second

#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound

#define rep(x,s,e) for (int x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e))?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()

namespace {
	bool st;
	int n,m;
	vector<int> al[20005];
	
	int w[20005];
	queue<int> q;
}

vector<signed> Mark(signed N, signed M, signed A, signed B,
                      vector<signed> U, vector<signed> V) {
						  
	
	st=(A>=3);
	n=N,m=M;
	
	if (st){
		rep(x,0,m){
			al[U[x]].pub(V[x]);
			al[V[x]].pub(U[x]);
		}
		
		memset(w,-1,sizeof(w));
		q.push(0);
		w[0]=0;
		
		while (!q.empty()){
			int u=q.front(); q.pop();
			for (auto it:al[u]) if (w[it]==-1){
				w[it]=w[u]+1;
				q.push(it);
			}
		}
		
		vector<signed> res;
		rep(x,0,m){
			res.pub(min(w[U[x]],w[V[x]])%3);
			cout<<res.back()<<" "<<U[x]<<" "<<V[x]<<endl;
		}
		return res;
	}
	else{
		return {};
	}
}
#include "Catherine.h"

#include <bits/stdc++.h>
using namespace std;

#define int long long
#define ii pair<int,int>
#define fi first
#define se second

#define puf push_front
#define pof pop_front
#define pub push_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound

#define rep(x,s,e) for (int x=(s)-((s)>(e));x!=(e)-((s)>(e));((s)<(e))?x++:x--)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()

namespace {
	bool st;
	int PREV=-1;
}

void Init(signed A, signed B) {
	st=(A>=3);
}

signed Move(vector<signed> y) {
	if (st){
		vector<int> v;
		rep(x,0,3) if (y[x] || PREV==x) v.pub(x);
		sort(all(v));
		
		if (sz(v)==1){
			return PREV=v[0];
		}
		else if (v[1]==1){
			return PREV=0;
		}
		else if (v[0]==1){
			return PREV=1;
		}
		else{
			return PREV=2;
		}
	}
	else{
		return 69;
	}
}
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 3836 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 39 ms 3836 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 42 ms 3608 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 42 ms 3608 KB Program didn't exit properly, or you printed something to stdout.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 1028 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1284 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1280 KB Wrong Answer [1]
2 Halted 0 ms 0 KB -