# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
711113 | Tyx2019 | Rainy Markets (CCO22_day1problem2) | C++17 | 809 ms | 37044 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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]=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";
}
}
//fuck u
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |