QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#101722#3859. Organizing SWERCPetroTarnavskyi#WA 2ms3388kbC++17924b2023-04-30 22:11:112023-04-30 22:11:13

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-30 22:11:13]
  • Judged
  • Verdict: WA
  • Time: 2ms
  • Memory: 3388kb
  • [2023-04-30 22:11:11]
  • Submitted

answer

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

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define FOR(i, a, b) for (int i = (a); i<(b); ++i)
#define RFOR(i, b, a) for (int i = (b)-1; i>=(a); --i)
#define MP make_pair
#define PB push_back
#define F first
#define S second

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;

const LL LINF = 1e18;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	LL v;
	cin >> n >> v;
	vector<pair<LL, LL>> vec;
	vector<int> t(n);
	for (int& ti : t) {
		cin >> ti;
	}
	FOR(i, 0, n) {
		int a;
		cin >> a;
		LL b = v * t[i] - a, c = v * t[i] + a;
		if (b >= 0 && c >= 0) {
			vec.emplace_back(b, c);
		}
	}
	sort(ALL(vec));
	vector<LL> d(SZ(vec) + 1, LINF);
	for (auto [b, c] : vec) {
		*upper_bound(ALL(d), c) = c;
	}
	cout << lower_bound(ALL(d), LINF) - d.begin() << "\n";
	return 0;
}

详细

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3388kb

input:

2
3
8 4
9 3
6 7
12
3 10
10 1
10 2
10 3
10 4
3 10
10 5
10 6
10 7
10 8
10 9
1 10

output:

2

result:

wrong answer 1st lines differ - expected: 'MOREPROBLEMS', found: '2'