Submission #743772

#TimeUsernameProblemLanguageResultExecution timeMemory
743772LCJLYSemiexpress (JOI17_semiexpress)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define int long long typedef pair<int,int>pii; int32_t main(){ ios::sync_with_stdio(0); cin.tie(0); int n,m,k,a,b,c,t; cin >> n >> m >> k; cin >> a >> b >> c; cin >> t; int arr[n+5]; for(int x=1;x<=n;x++){ cin >> arr[x]; } int counter=0; if((n-1)*b<=t) counter++; priority_queue<int>pq; for(int x=1;x<n-1;x++){ int timer=b*(arr[x]-1); if(timer>t) continue; int hold=(t-timer)/a; int target=min(arr[x+1]-1,hold+timer); counter+=(target-arr[x]); for(int y=0;y<k&&target<arr[x+1]-1;y++){ int hold2=timer+(range-arr[x]+1)*c; if(hold2>t) break; int hold3=(t-hold2)/a; int target2=min(arr[x+1]-1,target+hold3+1); pq.push(target2-target); target=target2; } } for(int x=m;x<k;x++){ if(pq.empty()) break; counter+=pq.top(); pq.pop(); } cout << counter-1; }

Compilation message (stderr)

semiexpress.cpp: In function 'int32_t main()':
semiexpress.cpp:33:21: error: 'range' was not declared in this scope
   33 |    int hold2=timer+(range-arr[x]+1)*c;
      |                     ^~~~~