답안 #940581

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
940581 2024-03-07T10:59:04 Z Ghetto 메기 농장 (IOI22_fish) C++17
0 / 100
20 ms 8796 KB
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const int MAX_N = 1e5 + 5, MAX_M = 3e5 + 5;

int n, m;
int x[MAX_M], y[MAX_M];
lint w[MAX_M];

lint w_at[2][MAX_N];
lint w_sum[2][MAX_N];
void precomp() {
    for (int i = 0; i <= 1; i++)
        for (int j = 0; j < n; j++)
            w_sum[i][j] = w_at[i][j] + ((j == 0) ? 0 : w_sum[i][j - 1]);
}

void init() {
    for (int i = 0; i <= 1; i++)
        for (int j = 0; j < n; j++)
            w_at[i][j] = 0;
}

lint max_weights(int tmp_n, int tmp_m, vector<int> tmp_x, vector<int> tmp_y, vector<int> tmp_w) {
    n = tmp_n;
    m = tmp_m;
    init();
    for (int i = 0; i < m; i++) {
        x[i] = tmp_x[i];
        y[i] = tmp_y[i];
        w[i] = tmp_w[i];
    }

    precomp();

    lint ans = w_sum[1][n - 1];
    for (int y = 0; y < n; y++) {
        lint new_ans = w_sum[1][n - 1] - w_sum[1][y] + w_sum[0][y];
        ans = max(ans, new_ans);
    }   
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 8796 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 6492 KB 1st lines differ - on the 1st token, expected: '2', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 6748 KB 1st lines differ - on the 1st token, expected: '10082010', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 6492 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 6492 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 6492 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 6748 KB 1st lines differ - on the 1st token, expected: '10082010', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 20 ms 8796 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '0'
2 Halted 0 ms 0 KB -