제출 #1036717

#제출 시각아이디문제언어결과실행 시간메모리
1036717thatsgonzalez메기 농장 (IOI22_fish)C++17
0 / 100
30 ms8740 KiB
#include "fish.h" #include <vector> #include <bits/stdc++.h> using namespace std; long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) { int line[N]; for(auto &x: line) x = 0; for(int i = 0; i<M; i++){ line[X[i]] = W[i]; } long long dp[2][N]; for(auto &item: dp) for(auto &cell: item) cell = 0; /* 0 : x 1 : y */ dp[0][0] = dp[1][0] = 0; for(int i = 1; i<N; i++){ dp[0][i] = dp[1][i-1]+line[i]; dp[1][i] = dp[0][i-1]+line[i-1]; } return max(dp[0][N-1],dp[1][N-1]); }
#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...