제출 #592210

#제출 시각아이디문제언어결과실행 시간메모리
592210farhan132비스킷 담기 (IOI20_biscuits)C++17
42 / 100
1089 ms49888 KiB
#include "biscuits.h"
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef pair<ll , ll> ii;
 
#define ff first
#define ss second
#define pb push_back
#define in insert

unordered_map < ll , ll > mp[61];
vector < ll > a; ll x;

ll DP(ll pos, ll val){
	if(pos >= a.size() && val == 0) return 1;
	if(pos < a.size()){
		val += a[pos];
	}
	if(mp[pos].count(val)) return mp[pos][val];
	ll ret = DP(pos + 1, val / 2);
	if(val >= x){
		ret += DP(pos + 1, (val - x)/2);
	}
	return mp[pos][val] = ret;
}

long long count_tastiness(long long _x, std::vector<long long> _a) {
	for(ll i = 0; i <= 60; i++) mp[i].clear();
	a = _a; x = _x;
	return DP(0, 0);
}

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

biscuits.cpp: In function 'll DP(ll, ll)':
biscuits.cpp:18:9: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   18 |  if(pos >= a.size() && val == 0) return 1;
      |     ~~~~^~~~~~~~~~~
biscuits.cpp:19:9: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  if(pos < a.size()){
      |     ~~~~^~~~~~~~~~
#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...