| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1356129 | kawhiet | Sequence (APIO23_sequence) | C++20 | 24 ms | 4160 KiB |
#include <bits/stdc++.h>
#include "sequence.h"
using namespace std;
int sequence(int n, vector<int> a) {
int ans = 0;
for (int k = 1; k <= 3; k++) {
int x = 0, y = 0, z = 0;
for (int l = 0, r = 0; r < n; r++) {
if (a[r] > k) {
z++;
} else if (a[r] == k) {
y++;
} else {
x++;
}
while (max(x, z) > r - l + 1) {
if (a[l] > k) {
z--;
} else if (a[l] == k) {
y--;
} else {
x--;
}
l++;
}
ans = max(ans, y);
}
}
return ans;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
