QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#696804 | #8768. Arrested Development | Miguel03121 | WA | 25ms | 42344kb | C++14 | 833b | 2024-11-01 02:03:13 | 2024-11-01 02:03:13 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define F(i, a, b) for (int i = a; i < b; i++)
#define ALL(x) x.begin(), x.end()
#define IOS ios_base::sync_with_stdio(0)
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;
#define N 5000000
int main() {
IOS;
cin.tie(0), cout.tie(0);
int n;
cin >> n;
int a, b;
vector<int> options(N + 1, 1e8);
options[0] = 0;
F(j, 0, n) {
cin >> a >> b;
vector<int> tmp(N + 1, 1e8);
F(i, 0, j * 100000 + 1) {
tmp[i + a] = min(tmp[i + a], options[i]);
tmp[i] = min(tmp[i], options[i] + b);
}
cout << endl;
options = tmp;
}
int ans = 1e8;
F(i, 0, N + 1) { ans = min(ans, max(options[i], i)); }
cout << ans << '\n';
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 25ms
memory: 42344kb
input:
4 100 1 1 90 1 20 1 20
output:
3
result:
wrong answer 1st lines differ - expected: '3', found: ''