제출 #1031240

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

typedef long long ll;

long long count_tastiness(long long X, std::vector<long long> a) {
	while(a.size()<60) a.push_back(0);
	int K=a.size();

	vector<ll> good; // set of good y's
	good.push_back(0);

	ll sum=0;
	for(int b=0;b<60;b++) {	
		sum+=a[b]*(1LL<<b);
		int s=good.size();
		for(int i=0;i<s;i++) {
			ll y=good[i]+(1LL<<b);
			if(y<=sum/X) {
				good.push_back(y);
			} else {
				break;
			}
		}
	}

	return good.size();
}

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:9:6: warning: unused variable 'K' [-Wunused-variable]
    9 |  int K=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...