CF 797, got stuck on E and had to leave, went pretty well
This commit is contained in:
48
codeforces/rounds/797/c.cpp
Normal file
48
codeforces/rounds/797/c.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef unsigned long long ull;
|
||||
|
||||
void test_case(int tc){
|
||||
int n;
|
||||
cin >> n;
|
||||
|
||||
vector<int> s(n);
|
||||
vector<int> f(n);
|
||||
|
||||
for(size_t i = 0; i < n; ++i){
|
||||
cin >> s[i];
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < n; ++i){
|
||||
cin >> f[i];
|
||||
|
||||
if(i != 0){
|
||||
cout << f[i] - max(s[i], f[i-1]) << " ";
|
||||
} else {
|
||||
cout << f[i] - s[i] << " ";
|
||||
}
|
||||
}
|
||||
|
||||
cout << "\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int t;
|
||||
cin >> t;
|
||||
|
||||
for(int tc = 1; tc <= t; ++tc){
|
||||
test_case(tc);
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user