# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
907635 | OAleksa | Group Photo (JOI21_ho_t3) | C++14 | 1 ms | 348 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>
//ako ovaj vaso daso misli da me pobedjuje.....
using namespace std;
#define int long long
#define f first
#define s second
const int N = 5010;
int dp[N], a[N], n, cost[N][N], fenw[N], pos[N];
//cost[i][j] -> prvih i je reseno i ja pocinjem od j
//prvi broj je i + 1
void add(int v, int val) {
for (int i = v;i < N;i += (i & -i))
fenw[i] += val;
}
int get(int v) {
int res = 0;
for (int i = v;i > 0;i -= (i & -i))
res += fenw[i];
return res;
}
void solve() {
for (int i = 1;i <= n;i++) {
int s = 0;
vector<int> p(n + 1);
for (int j = n;j >= 1;j--) {
if (a[j] < i)
s++;
else
p[a[j]] = pos[a[j]] + s;
}
# | 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... |