제출 #777918

#제출 시각아이디문제언어결과실행 시간메모리
777918Mouad_ouj메기 농장 (IOI22_fish)C++17
0 / 100
18 ms3540 KiB
#include "fish.h"//sub3 #include <bits/stdc++.h> using namespace std; long long max_weights(int n, int m,vector<int> x,vector<int> y,vector<int> w) { long long tab[n]={0},ans=0,dp[n]; for(int a=0;a<m;a++) tab[a]+=w[x[a]]; dp[0]=tab[0]; dp[1]=max(tab[0],tab[1]); for(int a=2;a<n;a++) dp[a]=max(dp[a-1],dp[a-2]+tab[a]); return dp[n-1]; }

컴파일 시 표준 에러 (stderr) 메시지

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:6:26: warning: unused variable 'ans' [-Wunused-variable]
    6 |     long long tab[n]={0},ans=0,dp[n];
      |                          ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...