답안 #739743

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
739743 2023-05-11T07:58:29 Z Nonoze 메기 농장 (IOI22_fish) C++17
0 / 100
24 ms 3540 KB
#include "fish.h"

#include <bits/stdc++.h>
using namespace std;

long long max_weights(int n, int m, vector<int> X, vector<int> Y, vector<int> W) {
	bool tacha=true, tachb=true, tachc=true;
	for (int i = 0; i < m; ++i)
	{
		if (X[i]%2) tacha=false;
		if (X[i]>1) tachb=false;
		if (Y[i]) tachc=false;
	}
	if (tacha)
	{
		int ans=0;
		for (int i = 0; i < m; ++i) ans+=W[i];
		return ans;
	}
	if (tachb)
	{
		int sommegauche=0, sommedroite=0;
		for (int i = 0; i < m; ++i)
		{
			if (X[i]==0) sommegauche+=W[i];
			else sommedroite+=W[i];
		}
		return max(sommegauche, sommedroite);
	}
	return 0;
}

Compilation message

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:7:31: warning: variable 'tachc' set but not used [-Wunused-but-set-variable]
    7 |  bool tacha=true, tachb=true, tachc=true;
      |                               ^~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 24 ms 3540 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '709728670'
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 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB 1st lines differ - on the 1st token, expected: '3', found: '0'
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB 1st lines differ - on the 1st token, expected: '882019', found: '0'
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 24 ms 3540 KB 1st lines differ - on the 1st token, expected: '40313272768926', found: '709728670'
2 Halted 0 ms 0 KB -