답안 #489100

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
489100 2021-11-21T07:37:57 Z cheissmart Semiexpress (JOI17_semiexpress) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#pragma GCC optimize("trapv")
#define IO_OP ios::sync_with_stdio(0), cin.tie(0)
#define F first
#define S second
#define V vector
#define PB push_back
#define EB emaplce_back
#define MP make_pair
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;

const int INF = 1e9 + 7, N = 3005;

int s[N];

signed main()
{
	IO_OP;

	int n, m, k, a, b, c;
	ll t;
	cin >> n >> m >> k >> a >> b >> c >> t;
	assert(k >= m);
	k -= m;
	int ans = 0;
	for(int i = 0; i < m; i++) {
		cin >> s[i];
	}
	vi tt;
	for(int i = 0; i < m - 1; i++) {
		ll now = 1LL * (s[i] - 1) * b;
		int pos = s[i];
		vi aux;
		while(now <= t && pos < s[i + 1] && int(aux.size()) < k + 1) {
			// now + a * x <= t
			// pos + x < s[i + 1]
			ll x = min<ll>((t - now) / a, s[i + 1] - pos - 1);
			assert(x >= 0);
			aux.PB(x + 1);
			pos = pos + x + 1;
			now += 1LL * (x + 1) * c;
		}
		if(aux.size()) {
			ans += aux[0];
			for(int i = 1; i < int(aux.size()); i++) {
				assert(aux[i] <= aux[i - 1]);
				tt.PB(aux[i]);
			}
		}
	}
	if(1LL * (s[m - 1] - 1) * b <= t)
		ans++;
	sort(ALttL(), greater<int>());
	for(int i = 0; i < min(int(tt.size()), k); i++)
		ans += tt[i];
	ans--;
	cout << ans << '\n';
	
			
}

Compilation message

semiexpress.cpp: In function 'int main()':
semiexpress.cpp:59:7: error: 'ALttL' was not declared in this scope; did you mean 'ALL'?
   59 |  sort(ALttL(), greater<int>());
      |       ^~~~~
      |       ALL