제출 #739747

#제출 시각아이디문제언어결과실행 시간메모리
739747Nonoze메기 농장 (IOI22_fish)C++17
3 / 100
83 ms7272 KiB
#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) {
	#define int long long
	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 m;
		return max(sommegauche, sommedroite);
	}
	#undef int
	return 0;
}

컴파일 시 표준 에러 (stderr) 메시지

fish.cpp: In function 'long long int max_weights(int, int, std::vector<int>, std::vector<int>, std::vector<int>)':
fish.cpp:10:31: warning: variable 'tachc' set but not used [-Wunused-but-set-variable]
   10 |  bool tacha=true, tachb=true, tachc=true;
      |                               ^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...