제출 #608485

#제출 시각아이디문제언어결과실행 시간메모리
608485CyberCow비스킷 담기 (IOI20_biscuits)C++17
42 / 100
1099 ms74996 KiB
#include "biscuits.h"
#include <vector>
#include <map>
using namespace std;
using ll = long long;
map<ll, ll> dp[150];

ll count_tastiness(ll x, vector<ll> a)
{
	for (int i = 0; i < 148; i++)
	{
		dp[i].clear();
	}
	for (int i = 0; i < 70; i++)
	{
		a.push_back(0);
	}
	ll ans = 1;
	dp[0][0] = 1;
	for (int i = 0; i < a.size(); i++)
	{
		for (auto it : dp[i])
		{
			if ((it.first + a[i] - x) >= 0)
			{
				dp[i + 1][(it.first + a[i] - x) / 2] += it.second;
				ans += it.second;
			}
			dp[i + 1][(it.first + a[i]) / 2] += it.second;
		}
	}
	return ans;
}

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

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:20:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |  for (int i = 0; i < a.size(); i++)
      |                  ~~^~~~~~~~~~
#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...