Submission #860746

# Submission time Handle Problem Language Result Execution time Memory
860746 2023-10-14T06:30:07 Z browntoad Two Transportations (JOI19_transportations) C++14
0 / 100
193 ms 1508 KB
#include <Azer.h>
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define SZ(x) (int)((x).size())

int n, a;
vector<int> u, v, c;
vector<pii> g[2005]; 
vector<int> dis(2005);
void InitA(int N, int A, vector<int> U, vector<int> V, vector<int> C){
	n = N;
	a = A;
	u = U;
	v = V;
	c = C;
	REP(i, a){
		g[u[i]].pb({v[i], c[i]});
		g[v[i]].pb({u[i], c[i]});
	}
}
vector<int> res;
int cnt = 0, cur = 0, typ = 1;
int ca, cb;
void ReceiveA(bool x){
	cnt = 2*cnt + x;
	cur++;
	if (cur >= 12){
		if (typ == 1){
			ca = cnt;
			typ = 2;
		}
		else if (typ == 2){
			cb = cnt;
			typ = 3;
		}
		else {
			g[ca].pb({cb, cnt});
			g[cb].pb({ca, cnt});
			typ = 1;
		}
		cnt = 0;
		cur = 0;

	}

}
vector<int> Answer(){
	priority_queue<pii, vector<pii>, greater<pii> > pq;
	pq.push({0, 0});
	while(pq.size()){
		pii tp = pq.top(); pq.pop();
		if (dis[tp.s] < 100000000) continue;
		dis[tp.s] = tp.f;
		for(pii x:g[tp.s]){
			pq.push({x.s+tp.f, x.f});
		}
	}
	vector<int> res;
	REP(i, n) res.pb(dis[i]);
	return res;
}
#include <Baijan.h>
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define SZ(x) (int)((x).size())
int n, b;
vector<int> s, t, d;
void snd(int a){
	vector<bool> f;
	while(a > 0){
		f.pb(a&1);
		a >>= 1;
	}
	while(SZ(f) < 12) f.pb(0);
	reverse(ALL(f));
	REP(i, 12){
		SendB(f[i]);
	}
}
void InitB(int N, int B, vector<int> S, vector<int> T, vector<int> D){
	n = N;
	b = B;
	s = S;
	t = T;
	d = D;	

	for (int i = 0; i < b; i++){
		snd(s[i]);
		snd(t[i]);
		snd(d[i]);
	}

}
void ReceiveB(bool y){
	return;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 476 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 664 KB Output is correct
2 Incorrect 193 ms 1140 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 185 ms 1508 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 72 ms 1080 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 72 ms 1080 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 72 ms 1080 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 476 KB Execution killed with signal 13
2 Halted 0 ms 0 KB -