QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#245189#4269. Rainy Marketsrsg230 3ms13892kbC++14792b2023-11-09 19:41:002023-11-09 19:41:01

Judging History

你现在查看的是最新测评结果

  • [2023-11-09 19:41:01]
  • 评测
  • 测评结果:0
  • 用时:3ms
  • 内存:13892kb
  • [2023-11-09 19:41:00]
  • 提交

answer

#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>

using namespace std;

const int NR = 1e6 + 5;

int n, a[NR], b[NR], c[NR], d[NR], e[NR], f[NR];

signed main() {
	ios :: sync_with_stdio(false), cin.tie(0);
	cin >> n;
	for (int i = 1; i <= n; ++i) cin >> a[i];
	for (int i = 1; i < n; ++i) cin >> b[i];
	for (int i = 1; i < n; ++i) cin >> c[i];
	for (int i = 1; i < n; ++i) e[i] = min(b[i], c[i]), b[i] -= e[i];
	d[1] = min(b[1], a[1]), b[1] -= d[1];
	for (int i = 1; i < n; ++i) {
		if (a[i + 1] < b[i]) return cout << "NO\n", 0;
		f[i] = b[i], a[i + 1] -= b[i];
		d[i + 1] = min(b[i + 1], a[i + 1]), b[i + 1] -= d[i + 1];
	}
	cout << "YES\n";
	for (int i = 1; i < n; ++i) cout << d[i] << ' ' << e[i] << ' ' << f[i] << '\n';
	return 0;
}

详细

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 5
Accepted
time: 3ms
memory: 13792kb

input:

3
10 15 10
20 20
0 0

output:

NO

result:

ok IMPOSSIBLE

Test #2:

score: -5
Wrong Answer
time: 0ms
memory: 13820kb

input:

2
813741488 132495829
946237313
0

output:

YES
813741488 0 132495825

result:

wrong answer the cost you declared is 813741488, but expected 0

Subtask #2:

score: 0
Wrong Answer

Test #36:

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

input:

3
10 15 10
20 20
0 11

output:

YES
10 0 10
5 11 4

result:

wrong answer the cost you declared is 10, but expected 5

Subtask #3:

score: 0
Skipped

Dependency #2:

0%

Subtask #4:

score: 0
Skipped

Dependency #1:

0%