# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
901312 | 2024-01-09T10:20:06 Z | tkm_algorithms | Sequence (APIO23_sequence) | C++17 | 2000 ms | 6392 KB |
#include <bits/stdc++.h> using namespace std; int sequence(int n, vector<int> a) { int ans = 0; multiset<int> x; for (int i = 0; i < n; ++i) { for (int j = i; j < n; ++j) { x.insert(a[j]); int cnt = 0; int d = (j - i) >> 1; int b = (j - i + 1) >> 1; int c1 = 0, c2 = 0; for (auto k: x) { if (cnt == d) c1 = k; if (cnt == b) { c2 = k; break; } ++cnt; } if (x.count(c1) > ans) ans = x.count(c1); if (x.count(c2) > ans) ans = x.count(c2); // cout << x.count(c1) << endl; // cout << x.count(c2) << endl; } x.clear(); } return ans; } //int main() { // int n; // cin >> n; // vector<int> a(n); // for (int i = 0; i < n; ++i) // cin >> a[i]; // cout << sequence(n, a); // return 0; //}
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 440 KB | Output is correct |
4 | Correct | 1 ms | 436 KB | Output is correct |
5 | Correct | 2 ms | 348 KB | Output is correct |
6 | Correct | 2 ms | 348 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
8 | Correct | 2 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 348 KB | Output is correct |
10 | Correct | 2 ms | 344 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 440 KB | Output is correct |
4 | Correct | 1 ms | 436 KB | Output is correct |
5 | Correct | 2 ms | 348 KB | Output is correct |
6 | Correct | 2 ms | 348 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
8 | Correct | 2 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 348 KB | Output is correct |
10 | Correct | 2 ms | 344 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 1 ms | 348 KB | Output is correct |
13 | Execution timed out | 2089 ms | 348 KB | Time limit exceeded |
14 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Execution timed out | 2066 ms | 6392 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Execution timed out | 2075 ms | 6304 KB | Time limit exceeded |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2054 ms | 5960 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 440 KB | Output is correct |
4 | Correct | 1 ms | 436 KB | Output is correct |
5 | Correct | 2 ms | 348 KB | Output is correct |
6 | Correct | 2 ms | 348 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
8 | Correct | 2 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 348 KB | Output is correct |
10 | Correct | 2 ms | 344 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 1 ms | 348 KB | Output is correct |
13 | Execution timed out | 2089 ms | 348 KB | Time limit exceeded |
14 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 440 KB | Output is correct |
4 | Correct | 1 ms | 436 KB | Output is correct |
5 | Correct | 2 ms | 348 KB | Output is correct |
6 | Correct | 2 ms | 348 KB | Output is correct |
7 | Correct | 2 ms | 348 KB | Output is correct |
8 | Correct | 2 ms | 504 KB | Output is correct |
9 | Correct | 2 ms | 348 KB | Output is correct |
10 | Correct | 2 ms | 344 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 1 ms | 348 KB | Output is correct |
13 | Execution timed out | 2089 ms | 348 KB | Time limit exceeded |
14 | Halted | 0 ms | 0 KB | - |