Submission #585866

# Submission time Handle Problem Language Result Execution time Memory
585866 2022-06-29T13:09:35 Z sofijavelkovska Mountains (NOI20_mountains) C++14
64 / 100
2000 ms 8104 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n, l, r, i, j;
    long long s=0;
    cin >> n;
    long long a[n];
    for (i=0; i<n; i++)
        cin >> a[i];
    for (i=0; i<n; i++)
    {
        l=0;
        r=0;
        for (j=0; j<i; j++)
            if (a[j]<a[i])
                l=l+1;
        for (j=i+1; j<n; j++)
            if (a[j]<a[i])
                r=r+1;
        s=s+(l*r);
    }
    cout << s;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 2085 ms 8104 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2071 ms 3124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2071 ms 3124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 2 ms 304 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 2 ms 304 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 300 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 74 ms 596 KB Output is correct
12 Correct 73 ms 488 KB Output is correct
13 Correct 73 ms 540 KB Output is correct
14 Correct 80 ms 536 KB Output is correct
15 Correct 73 ms 468 KB Output is correct
16 Correct 88 ms 596 KB Output is correct
17 Correct 81 ms 536 KB Output is correct
18 Correct 77 ms 540 KB Output is correct
19 Correct 69 ms 392 KB Output is correct
20 Correct 0 ms 304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 2071 ms 3124 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Execution timed out 2085 ms 8104 KB Time limit exceeded
3 Halted 0 ms 0 KB -