# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
22630 | 카시코이 (#40) | Unifying Values (KRIII5_UV) | C++14 | 500 ms | 48856 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <cstdio>
#include <cstring>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
const int MOD = 1000000007;
int n;
long long arr[10004];
long long sum[10004];
long long allsum;
int main() {
//freopen("input.txt", "r", stdin);
scanf("%d", &n);
for (int i = 1; i <= n; ++i) {
scanf("%lld", &arr[i]);
sum[i] = sum[i - 1] + arr[i];
}
allsum = sum[n];
unordered_map<long long, vector<int>> posbysum;
for (int i = 0; i <= n; ++i) {
posbysum[sum[i]];
posbysum[sum[i]].push_back(i);
}
long long ans = 0;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |