#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "local_debug.cpp"
#else
#define debug(...)
#define debugArr(...)
#endif
#define int long long
#define nl '\n'
#define sp ' '
#define F first
#define S second
#define SZ(s) (int)((s).size())
const int N = 3e5 + 5;
int a[N];
void solve() {
int n, k; cin >> n >> k;
int ans = 0;
for(int i = 0; i < n; ++i) cin >> a[i], ans += max(a[i], 0LL);
cout << ans << nl;
}
signed main() {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
int tc = 1;
// cin >> tc;
while(tc--) solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |