Last active
May 5, 2023 12:10
-
-
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++.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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