답안 #720921

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
720921 2023-04-09T20:18:50 Z Yell0 메기 농장 (IOI22_fish) C++17
9 / 100
31 ms 7512 KB
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
const int MN=1e5+2;
struct fish{fish(int xi,int yi,int wi):x(xi),y(yi),w(wi){} int x,y,w;};

ll max_weights(int N,int M,vector<int> X,vector<int> Y,vector<int> W) {
  ll dp[MN][2][2],w[MN],ans=0;
  for(int i=0;i<M;++i) w[X[i]+1]=W[i];
  for(int i=1;i<=N;++i) {
    dp[i][0][0]=max(dp[i-1][0][0],dp[i-1][1][0]);
    dp[i][1][0]=max(dp[i-1][0][1],dp[i-1][1][1]);
    dp[i][0][1]=max(dp[i-1][0][0]+w[i-1],dp[i-1][1][0])+w[i+1];
    dp[i][1][1]=max(dp[i-1][0][1],dp[i-1][1][1])-(i>1?w[i]:0)+w[i+1];
    ans=max({ans,dp[i][0][0],dp[i][0][1],dp[i][1][1],dp[i][1][0]});
  }
  return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 6000 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4180 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4180 KB Output is correct
2 Correct 3 ms 4180 KB Output is correct
3 Correct 18 ms 6396 KB Output is correct
4 Correct 12 ms 5588 KB Output is correct
5 Correct 30 ms 7472 KB Output is correct
6 Correct 25 ms 7508 KB Output is correct
7 Correct 30 ms 7512 KB Output is correct
8 Correct 31 ms 7500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4180 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4180 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 4180 KB 1st lines differ - on the 1st token, expected: '3', found: '2'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 4180 KB Output is correct
2 Correct 3 ms 4180 KB Output is correct
3 Correct 18 ms 6396 KB Output is correct
4 Correct 12 ms 5588 KB Output is correct
5 Correct 30 ms 7472 KB Output is correct
6 Correct 25 ms 7508 KB Output is correct
7 Correct 30 ms 7512 KB Output is correct
8 Correct 31 ms 7500 KB Output is correct
9 Incorrect 28 ms 7348 KB 1st lines differ - on the 1st token, expected: '99999', found: '66666'
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 23 ms 6000 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453'
2 Halted 0 ms 0 KB -