Submission #585867

# Submission time Handle Problem Language Result Execution time Memory
585867 2022-06-29T13:10:16 Z AtinaR Mountains (NOI20_mountains) C++14
0 / 100
2000 ms 1364 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int niza[n];
    for(int i=0; i<n; i++)
    {
        cin>>niza[i];
    }
    int res=0;
    for(int i=0; i<n; i++)
    {
        int tmp=niza[i];
        int l=0;
        int r=0;
        for(int j=0; j<n; j++)
        {
            if(i==j)
            {
                continue;
            }
            if(niza[j]<tmp&& i<j)
            {
                l++;
            }
            else if(niza[j]<tmp && i>j)
            {
                r++;
            }

        }
        res+=l*r;
    }
    cout<<res<<endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 2051 ms 1364 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2066 ms 1364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2066 ms 1364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2066 ms 1364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Execution timed out 2051 ms 1364 KB Time limit exceeded
3 Halted 0 ms 0 KB -