답안 #629071

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
629071 2022-08-14T06:57:43 Z Justin1 메기 농장 (IOI22_fish) C++17
0 / 100
91 ms 8808 KB
#include "fish.h"
 
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
ll ps1[100005], ps2[100005];
 
long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) {
	for (int i = 0; i < M; i++) {
		if (X[i] == 0) ps1[Y[i]] += W[i];
		else ps2[Y[i]] += W[i];
	}
	if (N == 2) {
		return max(ps1[N-1], ps2[0]);
	}
	for (int i = 1; i < N; i++) ps1[i] += ps1[i-1];
	for (int i = N-1; i >= 0; i--) ps2[i] += ps2[i+1];
	ll ans = ps2[0];
	for (int i = 0; i < N; i++) ans = max(ans,ps1[i] + ps2[i+1]);
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 3660 KB Output is correct
2 Correct 29 ms 4160 KB Output is correct
3 Correct 2 ms 1748 KB Output is correct
4 Correct 1 ms 1748 KB Output is correct
5 Correct 85 ms 8808 KB Output is correct
6 Incorrect 91 ms 8808 KB 1st lines differ - on the 1st token, expected: '300000000000000', found: '299997000000000'
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 47 ms 5420 KB Output is correct
3 Correct 59 ms 6496 KB Output is correct
4 Correct 23 ms 3560 KB Output is correct
5 Correct 30 ms 4172 KB Output is correct
6 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '4044', found: '0'
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1748 KB Output is correct
2 Correct 2 ms 1748 KB Output is correct
3 Incorrect 15 ms 3004 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '26722445760742'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '4044', found: '0'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '4044', found: '0'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '4044', found: '0'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1748 KB Output is correct
2 Correct 2 ms 1748 KB Output is correct
3 Incorrect 15 ms 3004 KB 1st lines differ - on the 1st token, expected: '21261825233649', found: '26722445760742'
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 24 ms 3660 KB Output is correct
2 Correct 29 ms 4160 KB Output is correct
3 Correct 2 ms 1748 KB Output is correct
4 Correct 1 ms 1748 KB Output is correct
5 Correct 85 ms 8808 KB Output is correct
6 Incorrect 91 ms 8808 KB 1st lines differ - on the 1st token, expected: '300000000000000', found: '299997000000000'
7 Halted 0 ms 0 KB -