제출 #1122384

#제출 시각아이디문제언어결과실행 시간메모리
1122384SofiatpcTwo Transportations (JOI19_transportations)C++14
6 / 100
777 ms10380 KiB
#include "Azer.h" #include <bits/stdc++.h> namespace { int n,p,id; int dist[2005]; } void InitA(int N, int A, std::vector<int> U, std::vector<int> V, std::vector<int> C) { ::n = N; ::id = 0; ::p = 0; } void ReceiveA(bool x) { if(p == 20){ ::id++; ::p = 0; } if(x)::dist[::id] += (1<<::p); ::p++; } std::vector<int> Answer() { std::vector<int> ans(n); for(int i = 0; i < n; i++) { ans[i] = dist[i]; } return ans; }
#include "Baijan.h" #include <bits/stdc++.h> namespace { int dist[2005]; std::vector<int> adj[2005], w[2005]; } // namespace void InitB(int n, int b, std::vector<int> s, std::vector<int> t, std::vector<int> d) { for(int i = 1; i <= n; i++)dist[i] = 1e6+5; for(int i = 0; i < b; i++){ ::adj[s[i]].push_back(t[i]); ::w[s[i]].push_back(d[i]); ::adj[t[i]].push_back(s[i]); ::w[t[i]].push_back(d[i]); } std::set< std::pair<int,int>> st; dist[0] = 0; st.insert({dist[0],0}); while(!st.empty()){ int x = st.begin()->second; st.erase(st.begin()); for(int i = 0; i < (int)adj[x].size(); i++){ int viz = adj[x][i], p = w[x][i]; if(dist[viz] > dist[x] + p){ st.erase({dist[viz],viz}); dist[viz] = dist[x]+p; st.insert({dist[viz],viz}); } } } //for(int i = 0; i < n; i++)std::cerr<<dist[i]<<" "; //std::cerr<<"\n"; for(int i = 0; i < n; i++) for(int j = 0; j < 20; j++){ if(dist[i] & (1<<j))SendB(1); else SendB(0); } } 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...