QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#101722 | #3859. Organizing SWERC | PetroTarnavskyi# | WA | 2ms | 3388kb | C++17 | 924b | 2023-04-30 22:11:11 | 2023-04-30 22:11:13 |
Judging History
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'