QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#719818#6773. True Story333zhanCompile Error//C++14751b2024-11-07 09:13:132024-11-07 09:13:13

Judging History

你现在查看的是最新测评结果

  • [2024-11-07 09:13:13]
  • 评测
  • [2024-11-07 09:13:13]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long

using namespace std;

void solve () {
	int n, k, x, p0;
	cin >> n >> k >> x >> p0;
	
	vector <int> s (n);
	for (int i = 0; i < n; i ++) {
		cin >> s[i];
	}
	
	vector <int> t (k + 1), p (k + 1);
	p[0] = p0;
	for (int i = 1; i <= k; i ++) {
		cin >> t[i];
	}
	for (int i = 1; i <= k; i ++) {
		cin >> p[i];
	}
	
	sort (s.begin (), s.end (), greater ());
	
	int j = 0;
	for (int i = 0; i <= k; i ++) {
		while (j < n && s[j] * (p[i] - t[i]) >= x) {
			j ++;
		}
	}
	
	cout << j << '\n';
}

signed main () {
    ios::sync_with_stdio (false);
    cin.tie (nullptr);

    int T = 1;
    // cin >> T;

    while (T --) {
        solve ();
    }

    return 0;
}  

Details

answer.code: In function ‘void solve()’:
answer.code:24:45: error: missing template arguments before ‘(’ token
   24 |         sort (s.begin (), s.end (), greater ());
      |                                             ^