# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1129878 | alosza | Candies (JOI18_candies) | C++20 | 15 ms | 15936 KiB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
int n2 = (n+1)/2;
vector<int> candies(n);
for(int i = 0; i < n; i++)
{
cin >> candies[i];
}
vector<vector<ll>> dp(n2+1); //k, index
for(int k = 0; k < n2+1; k++)
{
dp[k] = vector<ll>(n+1);
if(k > 0)
{
dp[k][1] = candies[0];
}
}
cout << "\n";
for(int k = 1; k < n2+1; k++)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |