# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
957777 | ALTAKEXE | Sequence (APIO23_sequence) | C++17 | 2063 ms | 7508 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 <bits/stdc++.h>
#define ll long long
#define f first
#define s second
using namespace std;
int sequence(int N, std::vector<int> A)
{
int ans = 0;
for (int i = 0; i < A.size(); i++)
{
int s = 0, c = 0;
for (int j = i; j > -1; j--)
{
if (A[i] == A[j])
c++;
if (A[i] > A[j])
s--;
if (A[i] < A[j])
s++;
if (abs(s) <= c)
ans = max(ans, c);
}
}
return ans;
}
Compilation message (stderr)
# | 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... |