Submission #120180

#TimeUsernameProblemLanguageResultExecution timeMemory
120180KLPPTwo Transportations (JOI19_transportations)C++14
8 / 100
1084 ms55128 KiB
#include "Azer.h" #include <vector> #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; #define rep(i,a,b) for(int i=a;i<b;i++) #define trav(a,v) for(auto a:v) int n_A; vector<pii > nei_A[2000]; vector<int> distanc; int cnt; int curr; int n1,n2,cost; void InitA(int N, int A, std::vector<int> U, std::vector<int> V, std::vector<int> C) { n_A=N; rep(i,0,U.size()){ nei_A[U[i]].push_back(pii(V[i],C[i])); nei_A[V[i]].push_back(pii(U[i],C[i])); } n1=-1; n2=-1; cost=-1; } void ReceiveA(bool x) { if(x)curr+=(1<<cnt); cnt++; if(cnt==11){ //cout<<curr<<endl; if(n1==-1){ n1=curr; }else{ if(n2==-1)n2=curr; else{ cost=curr; nei_A[n1].push_back(pii(n2,cost)); nei_A[n2].push_back(pii(n1,cost)); n1=-1; n2=-1; cost=-1; } } curr=0; cnt=0; } } std::vector<int> Answer() { rep(i,0,n_A)distanc.push_back(100000000); distanc[0]=0; priority_queue<pii> pq; pq.push(pii(0,0)); while(!pq.empty()){ pii x=pq.top();pq.pop(); int u=x.first; int d=-x.second; if(d>distanc[u])continue; trav(v,nei_A[u]){ if(distanc[v.first]>v.second+d){ distanc[v.first]=v.second+d; pq.push(pii(v.first,-distanc[v.first])); } } } return distanc; }
#include "Baijan.h" #include <vector> #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; #define rep(i,a,b) for(int i=a;i<b;i++) #define trav(a,v) for(auto a:v) int n; vector<pii > nei[2000]; int dist[2000]; void InitB(int N, int B, std::vector<int> S, std::vector<int> T, std::vector<int> D) { rep(i,0,S.size()){ rep(j,0,11){ if((S[i]&(1<<j))>0)SendB(true); else SendB(false); } rep(j,0,11){ if((T[i]&(1<<j))>0)SendB(true); else SendB(false); } rep(j,0,11){ if((D[i]&(1<<j))>0)SendB(true); else SendB(false); } } } void ReceiveB(bool y) { }

Compilation message (stderr)

Azer.cpp: In function 'void InitA(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Azer.cpp:9:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,a,b) for(int i=a;i<b;i++)
Azer.cpp:20:7:
   rep(i,0,U.size()){
       ~~~~~~~~~~~~               
Azer.cpp:20:3: note: in expansion of macro 'rep'
   rep(i,0,U.size()){
   ^~~

Baijan.cpp: In function 'void InitB(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
Baijan.cpp:9:33: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define rep(i,a,b) for(int i=a;i<b;i++)
Baijan.cpp:16:7:
   rep(i,0,S.size()){
       ~~~~~~~~~~~~               
Baijan.cpp:16:3: note: in expansion of macro 'rep'
   rep(i,0,S.size()){
   ^~~
#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...