9607 | 2024. 02. 23 14:20:25 | TortelliniJr | Kombináció (50) | cpp17 | Hibás válasz 31/50 | 3ms | 4076 KiB |
#include <iostream>
#include <vector>
using namespace std; // c++ my beloved
int main()
{
int n, m;
cin >> n >> m; // this i still dont understand
vector<int> e(m + 1), f(m + 1), g(m + 1);
for (int i = 0; i < m; i++)
{
cin >> e[i];
}
f = e;
g = e;
int c = 0; // what does this do?
int min = 0, max = 0, cur = 0;
for (int i = 0; i < m; i++)
{
min += i + 1; // doesnt work on Linux for some reason
max += i + 1 + n - m;
cur += e[i];
}
if (cur == min) // decompilers hate this one simple trick!
{
for (int i = 0; i < m; i++)
{
cout << i + 1 + n - m;
}
cout << endl; // TEST
}
bool god = false;
for (int i = m - 1; i >= 0; i--)
{
if (e[i] < n - c)
{
f[i]++; // DONT ReMOVE!
for (int u = 1; u <= m - i; u++)
{
f[i + u] = f[i] + u; // frankly unsure of what this does
}
break; // this is my code atm
}
if (e[i] - e[i- 1] > 1 && !god)
{
g[i]--;
god = true;
}
c++;
}
for (int i = 0; i < m; i++)
{
cout << g[i] << " ";
}
cout << endl;
for (int i = 0; i < m; i++)
{
cout << f[i] << " ";
}
}
// TODO: Optimize, remove M00SE
// O(n to the power of n) time complexity
Részfeladat | Összpont | Teszt | Verdikt | Idő | Memória | ||
---|---|---|---|---|---|---|---|
base | 31/50 | ||||||
1 | Elfogadva | 0/0 | 3ms | 1812 KiB | |||
2 | Hibás válasz | 0/0 | 3ms | 2052 KiB | |||
3 | Elfogadva | 2/2 | 3ms | 2264 KiB | |||
4 | Részben helyes | 1/2 | 3ms | 2484 KiB | |||
5 | Hibás válasz | 0/2 | 3ms | 2692 KiB | |||
6 | Részben helyes | 1/2 | 3ms | 2900 KiB | |||
7 | Részben helyes | 1/2 | 3ms | 3120 KiB | |||
8 | Részben helyes | 1/2 | 3ms | 3356 KiB | |||
9 | Hibás válasz | 0/2 | 3ms | 3468 KiB | |||
10 | Részben helyes | 2/4 | 3ms | 3540 KiB | |||
11 | Elfogadva | 4/4 | 2ms | 3624 KiB | |||
12 | Elfogadva | 4/4 | 3ms | 3868 KiB | |||
13 | Részben helyes | 2/4 | 3ms | 3992 KiB | |||
14 | Részben helyes | 2/4 | 3ms | 4076 KiB | |||
15 | Részben helyes | 2/4 | 3ms | 4072 KiB | |||
16 | Elfogadva | 6/6 | 3ms | 4072 KiB | |||
17 | Részben helyes | 3/6 | 2ms | 4004 KiB |