Skip to content

Commit

Permalink
Add 26145.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Mar 24, 2024
1 parent 2cca9ed commit 7058a4d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions 26xxx/26145.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include <iostream>
#include <vector>
using namespace std;

void solve(void) {
int n, m; cin >> n >> m;
vector<int> s(n);
for (int i=0; i<n; i++) cin >> s[i];
vector<vector<int>> t(n, vector<int>(n+m));
for (int i=0; i<n; i++) for (int j=0; j<n+m; j++) cin >> t[i][j];

vector<int> ans(n+m, 0);
for (int i=0; i<n; i++) ans[i] = s[i];
for (int i=0; i<n; i++) {
for (int j=0; j<n+m; j++) {
ans[j] += t[i][j];
ans[i] -= t[i][j];
}
}

for (int i=0; i<n+m; i++) {
cout << ans[i] << " ";
}
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

solve();
return 0;
}

0 comments on commit 7058a4d

Please sign in to comment.