QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#876419 | #4269. Rainy Markets | hhoppitree | Compile Error | / | / | C++17 | 885b | 2025-01-30 21:06:57 | 2025-01-30 21:06:58 |
Judging History
This is the latest submission verdict.
- [2025-01-30 21:06:58]
- Judged
- Verdict: Compile Error
- Time: 0ms
- Memory: 0kb
- [2025-01-30 21:06:57]
- Submitted
answer
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int a[N], b[N], c[N], f[N];
signed main() {
int n; scanf("%d", &n);
for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
for (int i = 1; i < n; ++i) scanf("%d", &b[i]);
for (int i = 1; i < n; ++i) scanf("%d", &c[i]);
f[n] = a[n];
for (int i = n - 1; i >= 1; --i) {
f[i] = a[i] - max(b[i] - c[i] - f[i + 1], 0);
if (f[i] < 0) return 0 & puts("NO");
}
vector< array<int, 3> > res;
for (int i = 1; i < n; ++i) {
int p = min(a[i], b[i]), q = min(b[i] - p, f[i + 1]);
res.push_back({p, b[i] - p - q, q});
a[i + 1] -= t;
}
long long S = 0;
for_each(res.begin(), res.end(), [&](auto x) { S += x[1]; });
puts("YES"), printf("%lld\n", S);
for (auto [x, y, z] : res) printf("%d %d %d\n", x, y, z);
return 0;
}
詳細信息
answer.code: In function ‘int main()’: answer.code:23:21: error: ‘t’ was not declared in this scope 23 | a[i + 1] -= t; | ^ answer.code:10:17: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | int n; scanf("%d", &n); | ~~~~~^~~~~~~~~~ answer.code:11:39: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | for (int i = 1; i <= n; ++i) scanf("%d", &a[i]); | ~~~~~^~~~~~~~~~~~~ answer.code:12:38: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | for (int i = 1; i < n; ++i) scanf("%d", &b[i]); | ~~~~~^~~~~~~~~~~~~ answer.code:13:38: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | for (int i = 1; i < n; ++i) scanf("%d", &c[i]); | ~~~~~^~~~~~~~~~~~~