# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1044694 | Dan4Life | 메기 농장 (IOI22_fish) | C++17 | 197 ms | 481728 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sz(a) (int)a.size()
#define all(a) begin(a),end(a)
using ll = long long;
using vi = vector<int>;
const int mxN = (int)1e5+10;
const int mxN2 = (int)3e2+10;
const ll LINF = (ll)2e18;
int n, m;
struct Fish{ int x, y; ll w; };
vector<Fish> fishes;
ll dp[mxN2][mxN2][mxN2];
ll pref[4][mxN];
ll max_weights(int N, int M, vi _X, vi _Y, vi _W) {
n = N, m = M; ll ans = 0;
for(int i = 0; i < m; i++)
fishes.pb({_X[i]+1,_Y[i]+1,_W[i]});
sort(all(fishes),[&](Fish a, Fish b){
if(a.x!=b.x) return a.x<b.x;
return a.y<b.y;
});
if(fishes.back().x <=2){
for(int i = 0; i < m; i++){
auto [x,y,w] = fishes[i];
pref[x][y]+=w;
}
for(int i = 0; i <= n; i++)
for(int j = 1; j <= n; j++)
pref[i][j]+=pref[i][j-1];
for(int i = 0; i <= n; i++){
ans = max({ans, pref[1][i], pref[2][i]});
}
return ans;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |