제출 #613367

#제출 시각아이디문제언어결과실행 시간메모리
613367penguinhacker비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1070 ms15756 KiB
#include "biscuits.h"
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ar array

ll count_tastiness(ll x, vector<ll> a) {
	map<ll, ll> dp;
	dp[0]=1;
	for (int i=0; i<a.size()||dp.size()>1; ++i) {
		map<ll, ll> dp2;
		for (auto b : dp) {
			ll cur=b.first+(i<a.size()?a[i]:0);
			dp2[cur/2]+=b.second;
			if (cur>=x)
				dp2[(cur-x)/2]+=b.second;
		}
		swap(dp, dp2);
	}
	return dp[0];
}

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

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