# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1123886 | Aviansh | Fruits (NOI22_fruits) | C++17 | 866 ms | 1114112 KiB |
#include <bits/stdc++.h>
using namespace std;
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int a[n],c[n];
bool fix[n];
fill(fix,fix+n,0);
for(int &i : a){
cin >> i;
if(i!=-1)
i--;
fix[i]=1;
}
for(int &i : c){
cin >> i;
}
int dp[n][n];
//maxind,maxval
int temp=0;
for(int i = 0;i<n;i++){
if(a[0]==-1){
if(!fix[i]){
temp=c[i];
}
dp[0][i]=temp;
# | 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... |