제출 #152564

#제출 시각아이디문제언어결과실행 시간메모리
152564usernameTwo Transportations (JOI19_transportations)C++14
0 / 100
4 ms752 KiB
#include "Azer.h" #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; #define REP(i,j,k) for(int i=(j);i<(k);++i) #define RREP(i,j,k) for(int i=int(j)-1;i>=(k);--i) #define ALL(a) a.begin(),a.end() #define pb push_back #define f first #define s second #define de(...) cerr<<__VA_ARGS__ #define ar(a,s,t) {REP(__i,s,t)de(a[__i]<<' ');de(endl);} namespace{ const int maxn=2009,inf=1e9; int n,ls=0,t=0,fin=0,r,tmp,d[maxn]; bitset<maxn>c; vector<pii>g[maxn]; priority_queue<pii,vector<pii>,greater<pii>>pq; void send(int x,int l){RREP(i,l,0)SendA((x>>i)&1);} void rlx(int u,int x){ d[u]=x; c[u]=1; ++fin; ls=d[u]; REP(i,0,g[u].size()){ pii&ee=g[u][i]; if(d[u]+ee.s>d[ee.f]){ d[ee.f]=d[u]+ee.s; pq.push({d[ee.f],ee.f}); } } } void proc(){ if(t==0||t==21){ while(pq.size()&&c[pq.top().s])pq.pop(); send(pq.size()?pq.top().f-ls:511,9); t=1; }else if(t==9){ r+=ls; if(pq.empty()||r<pq.top().f)tmp=r; else{ pii tt=pq.top();pq.pop(); send(tt.s,11); t+=11; rlx(tt.s,tt.f); } }else rlx(r,tmp); } } void InitA(int _n,int a,vector<int>u,vector<int>v,vector<int>c) { } void ReceiveA(bool x){ } vector<int>Answer(){ vector<int>ret; return ret; }
#include "Baijan.h" #include<bits/stdc++.h> using namespace std; typedef pair<int,int> pii; #define REP(i,j,k) for(int i=(j);i<(k);++i) #define RREP(i,j,k) for(int i=int(j)-1;i>=(k);--i) #define ALL(a) a.begin(),a.end() #define pb push_back #define f first #define s second #define de(...) cerr<<__VA_ARGS__ #define ar(a,s,t) {REP(__i,s,t)de(a[__i]<<' ');de(endl);} namespace{ const int maxn=2009,inf=1e9; int n,ls=0,t=0,fin=0,r,tmp,d[maxn]; bitset<maxn>c; vector<pii>g[maxn]; priority_queue<pii,vector<pii>,greater<pii>>pq; void send(int x,int l){RREP(i,l,0)SendB((x>>i)&1);} void rlx(int u,int x){ d[u]=x; c[u]=1; ++fin; ls=d[u]; REP(i,0,g[u].size()){ pii&ee=g[u][i]; if(d[u]+ee.s>d[ee.f]){ d[ee.f]=d[u]+ee.s; pq.push({d[ee.f],ee.f}); } } } void proc(){ if(t==0||t==21){ while(pq.size()&&c[pq.top().s])pq.pop(); send(pq.size()?pq.top().f-ls:511,9); t=1; }else if(t==9){ r+=ls; if(pq.empty()||r<pq.top().f)tmp=r; else{ pii tt=pq.top();pq.pop(); send(tt.s,11); t+=11; rlx(tt.s,tt.f); } }else rlx(r,tmp); } } void InitB(int _n,int a,vector<int>u,vector<int>v,vector<int>c) { } void ReceiveB(bool x){ }

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

Azer.cpp: In function 'void {anonymous}::rlx(int, int)':
Azer.cpp:5:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,j,k) for(int i=(j);i<(k);++i)
                                   ^
Azer.cpp:27:3: note: in expansion of macro 'REP'
   REP(i,0,g[u].size()){
   ^~~
Azer.cpp: At global scope:
Azer.cpp:35:7: warning: 'void {anonymous}::proc()' defined but not used [-Wunused-function]
  void proc(){
       ^~~~
Azer.cpp:16:6: warning: '{anonymous}::n' defined but not used [-Wunused-variable]
  int n,ls=0,t=0,fin=0,r,tmp,d[maxn];
      ^

Baijan.cpp: In function 'void {anonymous}::rlx(int, int)':
Baijan.cpp:5:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
 #define REP(i,j,k) for(int i=(j);i<(k);++i)
                                   ^
Baijan.cpp:27:3: note: in expansion of macro 'REP'
   REP(i,0,g[u].size()){
   ^~~
Baijan.cpp: At global scope:
Baijan.cpp:35:7: warning: 'void {anonymous}::proc()' defined but not used [-Wunused-function]
  void proc(){
       ^~~~
Baijan.cpp:16:6: warning: '{anonymous}::n' defined but not used [-Wunused-variable]
  int n,ls=0,t=0,fin=0,r,tmp,d[maxn];
      ^
#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...