제출 #765594

#제출 시각아이디문제언어결과실행 시간메모리
765594LeaRouse금 캐기 (IZhO14_divide)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define fastio ios_base::sync_with_stdio(0); cin.tie(0); #define ll long long #define ff first #define ss second using namespace std; const int MAX = 5e3+5; int A[MAX],B[MAX],C[MAX]; pair<int,int>dp[(1<<21)+5]; void go(){ int n; cin>>n; for(int i=0;i<n;i++){ cin>>A[i]>>B[i]>>C[i]; } ll ans=0; for(int i=0;i<n;i++){ ll sum=B[i]; ll ener=C[i]; for(int j=i+1;j<n;j++){ if(ener+C[j]>=abs(A[i]-A[j])){ ener+=C[j]; sum+=B[j]; pos=A[j]; } else{ break; } } ans=max(ans,sum); } cout<<ans<<endl; } int main(){ fastio; go(); return 0; }

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

divide.cpp: In function 'void go()':
divide.cpp:23:17: error: 'pos' was not declared in this scope; did you mean 'pow'?
   23 |                 pos=A[j];
      |                 ^~~
      |                 pow