Submission #754125

#TimeUsernameProblemLanguageResultExecution timeMemory
754125AdamGSTwo Transportations (JOI19_transportations)C++17
6 / 100
448 ms10368 KiB
#include "Azer.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
vector<int>wynik;
int akt=0, ile=0;
void InitA(int N, int A, vector<int>U, vector<int>V, vector<int>C) {
}
void ReceiveA(bool x) {
		if(x) akt+=1<<(ile%20);
		++ile;
		if(ile%20==0) {
			wynik.pb(akt);
			akt=0;
		}
}
vector<int>Answer() {
	return wynik;
}
#include "Baijan.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=2e3+7, INF=1e9+7;
vector<pair<int,int>>V[LIM];
int odl[LIM];
void wyslij(int x) {
	rep(i, 20) if(x&(1<<i)) SendB(1); else SendB(0);
}
void InitB(int N, int B, vector<int>S, vector<int>T, vector<int>D) {
	rep(i, B) {
		V[S[i]].pb({T[i], D[i]});
		V[T[i]].pb({S[i], D[i]});
	}
	rep(i, N) odl[i]=INF;
	priority_queue<pair<int,int>>q;
	q.push({0, 0});
	while(!q.empty()) {
		int o=-q.top().st, p=q.top().nd; q.pop();
		if(odl[p]<INF) continue;
		odl[p]=o;
		for(auto i : V[p]) if(odl[i.st]==INF) q.push({-o-i.nd, i.st});
	}
	rep(i, N) wyslij(odl[i]);
}
void ReceiveB(bool y) {

}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...