QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#90467 | #5252. Deforestation | ysghwzp# | Compile Error | / | / | C++14 | 730b | 2023-03-23 11:22:03 | 2023-03-23 11:22:04 |
Judging History
你现在查看的是最新测评结果
- [2023-08-10 23:21:45]
- System Update: QOJ starts to keep a history of the judgings of all the submissions.
- [2023-03-23 11:22:04]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2023-03-23 11:22:03]
- 提交
answer
#include <bits/stdc++.h>
using i64 = long long;
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
int W;
std::cin >> W;
std::function<std::pair<i64, int>()> dfs = [&]() -> std::pair<i64, int> {
int M, N;
std::cin >> M >> N;
std::vector<int> a(N);
i64 sum = 0;
for (int i = 0; i < N; i++) {
auto [ans, l] = dfs();
sum += ans;
sum += l / W;
l %= W;
a[i] = l;
}
std::sort(a.begin(), a.end());
int l = 0;
int i = 0;
while (i < N && l + a[i] <= W) {
l += a[i];
i += 1;
}
sum += N - i;
l += M;
return std::pair(sum, l);
};
auto [ans, l] = dfs();
ans += (l + W - 1) / W;
std::cout << ans << "\n";
return 0;
}
詳細信息
answer.code: In lambda function: answer.code:19:30: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 19 | auto [ans, l] = dfs(); | ^ answer.code:35:33: error: missing template arguments before ‘(’ token 35 | return std::pair(sum, l); | ^ answer.code: In function ‘int main()’: answer.code:38:14: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ 38 | auto [ans, l] = dfs(); | ^