답안 #721385

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
721385 2023-04-10T19:18:25 Z bLIC 메기 농장 (IOI22_fish) C++17
3 / 100
136 ms 9572 KB
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
  ll sum[N]{};
  for (int i = 0;i<M;i++){
    sum[X[i]]+=W[i]*1ll;
  }
  ll dp[N][2];
  // memset(dp, 0, sizeof(dp));
  dp[0][0] = 0;
  dp[0][1] = sum[0];
  ll ans = dp[0][1];
  for (int i = 1;i<N;i++){
    dp[i][0] = max(dp[i-1][1], dp[i-1][0]);
    dp[i][1] = dp[i-1][0]+sum[i];
    ans = max(ans, max(dp[i][0], dp[i][1]));
  }

  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 4196 KB Output is correct
2 Correct 35 ms 4936 KB Output is correct
3 Correct 2 ms 2644 KB Output is correct
4 Correct 2 ms 2644 KB Output is correct
5 Correct 88 ms 9568 KB Output is correct
6 Correct 136 ms 9572 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 2 ms 2644 KB Output is correct
3 Incorrect 16 ms 3632 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 2644 KB Output is correct
2 Correct 2 ms 2644 KB Output is correct
3 Incorrect 16 ms 3632 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '16359027219341'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 41 ms 4196 KB Output is correct
2 Correct 35 ms 4936 KB Output is correct
3 Correct 2 ms 2644 KB Output is correct
4 Correct 2 ms 2644 KB Output is correct
5 Correct 88 ms 9568 KB Output is correct
6 Correct 136 ms 9572 KB Output is correct
7 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
8 Halted 0 ms 0 KB -