# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1124620 | lmToT27 | Line Town (CCO23_day1problem3) | C++20 | 46 ms | 20216 KiB |
#include <bits/stdc++.h>
#define all(dataStructure) dataStructure.begin(),dataStructure.end()
using namespace std;
typedef long long ll;
const int MAX = 5e5 + 3;
const ll inf = 1e17;
const ll MOD[] = {1000000007, 998244353};
int n, h[MAX];
ll prefix[MAX], suffix[MAX];
int pPos[MAX][2], sPos[MAX][2];
void Solve() {
cin >> n;
for (int i = 1; i <= n; i++) cin >> h[i];
vector <int> t[2];
for (int i = 1; i <= n; i++) {
if (i & 1) {
if (h[i] == 1) t[0].push_back(i);
else t[1].push_back(i);
} else {
if (h[i] == -1) t[0].push_back(i);
else t[1].push_back(i);
}
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |