diff options
Diffstat (limited to 'codechef/hardCash')
| -rw-r--r-- | codechef/hardCash/hardCash.cpp | 14 | ||||
| -rw-r--r-- | codechef/hardCash/inp | 5 | ||||
| -rwxr-xr-x | codechef/hardCash/main | bin | 0 -> 31512 bytes | |||
| -rw-r--r-- | codechef/hardCash/main.cpp | 26 |
4 files changed, 31 insertions, 14 deletions
diff --git a/codechef/hardCash/hardCash.cpp b/codechef/hardCash/hardCash.cpp deleted file mode 100644 index 5f6862e..0000000 --- a/codechef/hardCash/hardCash.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include<bits/stdc++.h> - -using namespace std; - -int main () { - ios_base::sync_with_stdio(false); - cin.tie(NULL); - int tt; - cin >> tt; - while(tt--){ - - - } -} diff --git a/codechef/hardCash/inp b/codechef/hardCash/inp new file mode 100644 index 0000000..617f23b --- /dev/null +++ b/codechef/hardCash/inp @@ -0,0 +1,5 @@ +2 +5 7 +1 14 4 41 1 +3 9 +1 10 19 diff --git a/codechef/hardCash/main b/codechef/hardCash/main Binary files differnew file mode 100755 index 0000000..7aa621a --- /dev/null +++ b/codechef/hardCash/main diff --git a/codechef/hardCash/main.cpp b/codechef/hardCash/main.cpp new file mode 100644 index 0000000..2b49804 --- /dev/null +++ b/codechef/hardCash/main.cpp @@ -0,0 +1,26 @@ +#include <bits/stdc++.h> + +using namespace std; + +long long sum(vector<int> v) { + long long sum = 0; + for(int i = 0; i < v.size(); i++) { + sum += v[i]; + } + return sum; +} + +int main() { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int tt; + cin >> tt; + while (tt--) { + int n, k; + cin >> n >> k; + vector<int> v(n); + for (int &x : v) + cin >> x; + cout << sum(v) % k << '\n'; + } +} |
