# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
835330 | 2023-08-23T13:09:33 Z | Trumling | 메기 농장 (IOI22_fish) | C++17 | 25 ms | 6604 KB |
#include "fish.h" #include<bits/stdc++.h> using namespace std; #define F first #define S second #define all(x) x.begin(),x.end() typedef long long ll; #define pb push_back #define INF 9999999999999999 long long max_weights(int N, int M, vector<int> X, vector<int> Y,vector<int> W) { vector<vector<ll>>dp(2,vector<ll>(N,0)); vector<int>w(N,0); for(int i=0;i<M;i++) w[X[i]]=W[i]; dp[1][0]=0; for(int i=1;i<N;i++) { dp[1][i]=dp[0][i-1]+w[i]; dp[0][i]=dp[0][i-1]; dp[0][i]=max(dp[0][i],((i>1)?max(dp[1][i-2],dp[0][i-2]):0)+w[i-1]); } ll ans=0; for(int i=0;i<N;i++) ans=max(ans,max(dp[0][i],dp[1][i])); return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 19 ms | 4308 KB | 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 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 | Correct | 13 ms | 3628 KB | Output is correct |
4 | Correct | 10 ms | 4052 KB | Output is correct |
5 | Correct | 25 ms | 6604 KB | Output is correct |
6 | Correct | 22 ms | 5912 KB | Output is correct |
7 | Correct | 23 ms | 6456 KB | Output is correct |
8 | Correct | 24 ms | 6508 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '2' |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 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 | Correct | 13 ms | 3628 KB | Output is correct |
4 | Correct | 10 ms | 4052 KB | Output is correct |
5 | Correct | 25 ms | 6604 KB | Output is correct |
6 | Correct | 22 ms | 5912 KB | Output is correct |
7 | Correct | 23 ms | 6456 KB | Output is correct |
8 | Correct | 24 ms | 6508 KB | Output is correct |
9 | Incorrect | 23 ms | 6356 KB | 1st lines differ - on the 1st token, expected: '99999', found: '66666' |
10 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 19 ms | 4308 KB | 1st lines differ - on the 1st token, expected: '40313272768926', found: '803213453' |
2 | Halted | 0 ms | 0 KB | - |