// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.
// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.// The term 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' is not recognized as the name of
// a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
// included, verify that the path is correct and try again.
#include <bits/stdc++.h>
using namespace std;
#define int long long
main(){
int N;
cin >> N;
int B[N],U[N-1],P[N-1];
for(int i=0;i<N;i++) cin >> B[i];
for(int i=0;i<N-1;i++) cin >> P[i];
int L[N-1], R[N-1];
int prevr=0;
for(int i=0;i<N-1;i++){
L[i]=min(P[i],B[i]-prevr);
R[i]=P[i]-L[i];
if(R[i]>B[i+1]){
cout << "NO";
return 0;
}
prevr=R[i];
}
cout << "YES\n0\n";
for(int i=0;i<N-1;i++){
cout << L[i] << " 0 " << R[i] << "\n";
}
}
// 243604620
Compilation message
Main.cpp:150:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
150 | main(){
| ^~~~
Main.cpp: In function 'int main()':
Main.cpp:153:14: warning: unused variable 'U' [-Wunused-variable]
153 | int B[N],U[N-1],P[N-1];
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
587 ms |
32080 KB |
Output is correct |
5 |
Correct |
727 ms |
32076 KB |
Output is correct |
6 |
Correct |
576 ms |
31976 KB |
Output is correct |
7 |
Correct |
776 ms |
32188 KB |
Output is correct |
8 |
Correct |
5 ms |
468 KB |
Output is correct |
9 |
Correct |
4 ms |
468 KB |
Output is correct |
10 |
Correct |
439 ms |
38388 KB |
Output is correct |
11 |
Correct |
501 ms |
41032 KB |
Output is correct |
12 |
Correct |
947 ms |
54044 KB |
Output is correct |
13 |
Correct |
976 ms |
45880 KB |
Output is correct |
14 |
Correct |
691 ms |
34476 KB |
Output is correct |
15 |
Correct |
1072 ms |
55468 KB |
Output is correct |
16 |
Correct |
1099 ms |
55044 KB |
Output is correct |
17 |
Correct |
1103 ms |
55724 KB |
Output is correct |
18 |
Correct |
1183 ms |
55616 KB |
Output is correct |
19 |
Correct |
1102 ms |
55628 KB |
Output is correct |
20 |
Correct |
930 ms |
55604 KB |
Output is correct |
21 |
Correct |
928 ms |
55372 KB |
Output is correct |
22 |
Correct |
915 ms |
52052 KB |
Output is correct |
23 |
Correct |
959 ms |
55552 KB |
Output is correct |
24 |
Correct |
918 ms |
57556 KB |
Output is correct |
25 |
Correct |
780 ms |
36944 KB |
Output is correct |
26 |
Correct |
773 ms |
37068 KB |
Output is correct |
27 |
Correct |
987 ms |
58460 KB |
Output is correct |
28 |
Correct |
1100 ms |
56808 KB |
Output is correct |
29 |
Correct |
1081 ms |
59148 KB |
Output is correct |
30 |
Correct |
1050 ms |
55536 KB |
Output is correct |
31 |
Correct |
1049 ms |
53892 KB |
Output is correct |
32 |
Correct |
949 ms |
55232 KB |
Output is correct |
33 |
Correct |
830 ms |
36036 KB |
Output is correct |
34 |
Correct |
845 ms |
36604 KB |
Output is correct |
35 |
Correct |
831 ms |
36756 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
587 ms |
32080 KB |
Output is correct |
5 |
Correct |
727 ms |
32076 KB |
Output is correct |
6 |
Correct |
576 ms |
31976 KB |
Output is correct |
7 |
Correct |
776 ms |
32188 KB |
Output is correct |
8 |
Correct |
5 ms |
468 KB |
Output is correct |
9 |
Correct |
4 ms |
468 KB |
Output is correct |
10 |
Correct |
439 ms |
38388 KB |
Output is correct |
11 |
Correct |
501 ms |
41032 KB |
Output is correct |
12 |
Correct |
947 ms |
54044 KB |
Output is correct |
13 |
Correct |
976 ms |
45880 KB |
Output is correct |
14 |
Correct |
691 ms |
34476 KB |
Output is correct |
15 |
Correct |
1072 ms |
55468 KB |
Output is correct |
16 |
Correct |
1099 ms |
55044 KB |
Output is correct |
17 |
Correct |
1103 ms |
55724 KB |
Output is correct |
18 |
Correct |
1183 ms |
55616 KB |
Output is correct |
19 |
Correct |
1102 ms |
55628 KB |
Output is correct |
20 |
Correct |
930 ms |
55604 KB |
Output is correct |
21 |
Correct |
928 ms |
55372 KB |
Output is correct |
22 |
Correct |
915 ms |
52052 KB |
Output is correct |
23 |
Correct |
959 ms |
55552 KB |
Output is correct |
24 |
Correct |
918 ms |
57556 KB |
Output is correct |
25 |
Correct |
780 ms |
36944 KB |
Output is correct |
26 |
Correct |
773 ms |
37068 KB |
Output is correct |
27 |
Correct |
987 ms |
58460 KB |
Output is correct |
28 |
Correct |
1100 ms |
56808 KB |
Output is correct |
29 |
Correct |
1081 ms |
59148 KB |
Output is correct |
30 |
Correct |
1050 ms |
55536 KB |
Output is correct |
31 |
Correct |
1049 ms |
53892 KB |
Output is correct |
32 |
Correct |
949 ms |
55232 KB |
Output is correct |
33 |
Correct |
830 ms |
36036 KB |
Output is correct |
34 |
Correct |
845 ms |
36604 KB |
Output is correct |
35 |
Correct |
831 ms |
36756 KB |
Output is correct |
36 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
37 |
Halted |
0 ms |
0 KB |
- |