Submission #510256

# Submission time Handle Problem Language Result Execution time Memory
510256 2022-01-14T21:19:31 Z salamhassan Nizin (COCI16_nizin) C++14
20 / 100
1000 ms 4124 KB
#include <bits/stdc++.h>
using namespace std;
int a[1000007],n,l,r,ans;
int main()
{
    cin>>n;
    for (int i=0; i<n; i++)
    {
        cin>>a[i];
    }
    l=0;
    r=n-1;
    while (l<n/2)
    {
        if (a[l]==a[r])
        {
        l++;
        r--;
        }
        while (r>n/2 && a[l]!=a[r])
        {
        if (a[l]>a[r])
        {
            a[r-1]+=a[r];
            r--;
            n--;
            ans++;
        }
        else
        {
        a[l+1]+=a[l];
        l++;
        ans++;
        }

        }

    }

    cout<<ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Execution timed out 1086 ms 204 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 588 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 1596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 101 ms 3164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 132 ms 4124 KB Output isn't correct
2 Halted 0 ms 0 KB -