제출 #308175

#제출 시각아이디문제언어결과실행 시간메모리
308175arnold518Two Transportations (JOI19_transportations)C++14
0 / 100
274 ms1280 KiB
#include "Azer.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 2000; const int MAXA = 6e5; const int INF = 1e9; struct Edge { int u, v, w; }; static int N, A, B; static Edge E[MAXA+10], E2[MAXA+10]; static int ans[MAXN+10]; static vector<pii> adj[MAXN+10]; static int cnt=-10; struct Queue { int u, w; bool operator < (const Queue &p) const { return w>p.w; } }; static int dist[MAXN+10]; vector<int> Answer() { vector<int> ret=vector<int>(ans, ans+N); return ret; } void InitA(int _N, int _A, vector<int> _U, vector<int> _V, vector<int> _C) { N=_N; A=_A; for(int i=0; i<A; i++) E[i]={_U[i], _V[i], _C[i]}; } void dijk() { //printf("B : %d\n", B); for(int i=0; i<A; i++) { int u=E[i].u, v=E[i].v, w=E[i].w; adj[u].push_back({v, w}); adj[v].push_back({u, w}); } for(int i=0; i<B; i++) { int u=E2[i].u, v=E2[i].v, w=E2[i].w; printf("%d %d %d\n", u, v, w); adj[u].push_back({v, w}); adj[v].push_back({u, w}); } for(int i=0; i<N; i++) dist[i]=INF; priority_queue<Queue> PQ; PQ.push({0, 0}); while(!PQ.empty()) { Queue now=PQ.top(); PQ.pop(); if(dist[now.u]<=now.w) continue; //printf("%d %d\n", now.u, now.w); dist[now.u]=now.w; for(auto nxt : adj[now.u]) PQ.push({nxt.first, nxt.second+now.w}); } for(int i=0; i<N; i++) ans[i]=dist[i]; } void ReceiveA(bool x) { if(cnt<0) { if(x) { B|=(1<<(cnt+10)); } } else { if(x) { int t=cnt%31; if(t<11) E2[cnt/31].u|=(1<<t); else if(t<22) E2[cnt/31].v|=(1<<(t-11)); else E2[cnt/31].w|=(1<<(t-22)); } if(cnt==31*B-1) dijk(); } cnt++; }
#include "Baijan.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 2000; const int MAXB = 5e5; const int INF = 1e9; struct Edge { int u, v, w; }; static int N, B; static Edge E[MAXB+10]; static int ans[MAXN+10]; static vector<pii> adj[MAXN+10]; static int cnt=0; void InitB(int _N, int _B, vector<int> _U, vector<int> _V, vector<int> _C) { N=_N; B=_B; for(int i=0; i<B; i++) E[i]={_U[i], _V[i], _C[i]}; for(int i=0; i<B; i++) { int u=E[i].u, v=E[i].v, w=E[i].w; adj[u].push_back({v, w}); adj[v].push_back({u, w}); } for(int i=0; i<10; i++) { if(B&(1<<i)) SendB(1); else SendB(0); } for(int i=0; i<B; i++) { for(int j=0; j<11; j++) { if(E[i].u&(1<<j)) SendB(1); else SendB(0); } for(int j=0; j<11; j++) { if(E[i].v&(1<<j)) SendB(1); else SendB(0); } for(int j=0; j<9; j++) { if(E[i].w&(1<<j)) SendB(1); else SendB(0); } } } void ReceiveB(bool x) { }

컴파일 시 표준 에러 (stderr) 메시지

Baijan.cpp:22:12: warning: 'cnt' defined but not used [-Wunused-variable]
   22 | static int cnt=0;
      |            ^~~
Baijan.cpp:20:12: warning: 'ans' defined but not used [-Wunused-variable]
   20 | static int ans[MAXN+10];
      |            ^~~
#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...