Submission #955589

#TimeUsernameProblemLanguageResultExecution timeMemory
955589Trisanu_DasPacking Biscuits (IOI20_biscuits)C++17
42 / 100
1065 ms24068 KiB
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
 
long long count_tastiness(long long x, vector<long long> a){
	map<long long, long long> da;
	da[0] = 1;
	for(int i = 0; i < 60; i++) a.push_back(0);
	for(int i = 0; i < a.size(); i++){
		map<long long, long long> nov;
		for(auto j : da){
			nov[(j.first + a[i]) / 2] += j.second;
			if(j.first + a[i] >= x) nov[(j.first + a[i] - x) / 2] += j.second;
		}
		da = nov;
	}
	long long ans = 0;
	for(auto i : da) ans += i.second;
	return ans;
}

Compilation message (stderr)

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:9:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  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...