제출 #125649

#제출 시각아이디문제언어결과실행 시간메모리
125649tmwilliamlin168철로 (IOI14_rail)C++14
컴파일 에러
0 ms0 KiB
#include "rail.h" #include <bits/stdc++.h> using namespace std; const int mxN=5e3; array<int, 2> a[mxN]; map<int, int> mp; void findLocation(int n, int f, int *p, int *s) { p[0]=f; s[0]=1; mp[f]=0; for(int i=1; i<n; ++i) a[i]={getDistance(0, i), i}; sort(a, a+n); int l=0, r=a[1][1]; p[r]=f+a[1][0]; s[r]=2; mp[p[r]]=r; for(int i=2; i<n; ++i) { int dl=getDistance(l, a[i][1]), dr=getDistance(r, a[i][1]);//, t=s[mp[(p[l]+dl+p[r]-dr)/2]]; assert(mp.find((p[l]+dl+p[r]-dr)/2)!=mp.end()); t=s[mp[(p[l]+dl+p[r]-dr)/2]]; if(t^2) { p[a[i][1]]=p[l]+dl; s[a[i][1]]=2; if(p[a[i][1]]>p[r]) r=a[i][1]; } else { p[a[i][1]]=p[r]-dr; s[a[i][1]]=1; if(p[a[i][1]]<p[l]) l=a[i][1]; } mp[p[a[i][1]]]=a[i][1]; } }

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

rail.cpp: In function 'void findLocation(int, int, int*, int*)':
rail.cpp:23:3: error: 't' was not declared in this scope
   t=s[mp[(p[l]+dl+p[r]-dr)/2]];
   ^