Skip to content

Instantly share code, notes, and snippets.

@jiyometrik
Last active May 5, 2023 12:10
Show Gist options
  • Save jiyometrik/2ebf7fba08b4fd4094b0f2e86d96a15a to your computer and use it in GitHub Desktop.
Save jiyometrik/2ebf7fba08b4fd4094b0f2e86d96a15a to your computer and use it in GitHub Desktop.
a solution for the 2023 ec3 beginner competitive programming final contest's problem B: waterbottles in c++.
#include <bits/stdc++.h>
using namespace std;
#define int long long
int32_t main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int H, W, K;
cin >> H >> W >> K;
long long sum = 0, input;
for (int i = 0; i < H * W; i++) {
cin >> input;
sum += input;
}
cout << sum - (2 * W * H - H - W) * K;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment