QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#797332#9529. Farm ManagementSword1E1Compile Error//C++201.2kb2024-12-02 21:02:532024-12-02 21:03:01

Judging History

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

  • [2024-12-02 21:03:01]
  • 评测
  • [2024-12-02 21:02:53]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long

#define dbg(x...) \
do { \
std::cout << #x << " -> "; \
err(x); \
} while (0)

void err() {
	std::cout << std::endl;
}

template<class T, class... Ts>
void err(T arg, Ts &... args) {
	std::cout << fixed << setprecision(10) << arg << ' ';
	err(args...);
}

const int maxn = 1e5 + 5;
struct node {
	int w,l,r;
	bool operator < (const node & b) const {
		return w < b.r;
	}
}a[maxn];

void GENSHEN_START() {
	int n,m;cin >> n >> m;
	for (int i = 1;i <= n;i++) {
		cin >> a[i].w >> a[i].l >> a[i].r;
	}	
	sort (a + 1,a + 1 + n);
	int sum = 0;
	for (int i = 1;i <= n;i++) {
		sum += a[i].w;
	}
	vector <int> suf (n + 1),suf_val(n + 1);
	for (int i = n;i >= 1;i--) {
		suf[i] = suf[i + 1] + (a[i].r - a[i].l);
		suf_val[i] = (a[i].r - a[i].l) * a[i].w + suf_val[i + 1];
	}
	for (int i = 1;i <= n;i++) {
		int now = sum - a[i].l;
		int mod = m - now;
		int w = lower_bound(suf.rbegin(),suf.rbegin() + (n - i),mod) - suf.rbegin();
		if (w < )
	}
}

signed main()
{
	ios::sync_with_stdio(false);cin.tie(nullptr);
	int T = 1;
	//cin >> T;
	while (T--) GENSHEN_START();
	return 0;
}

Details

answer.code: In function ‘void GENSHEN_START()’:
answer.code:48:25: error: expected primary-expression before ‘)’ token
   48 |                 if (w < )
      |                         ^
answer.code:49:9: error: expected primary-expression before ‘}’ token
   49 |         }
      |         ^