제출 #834063

#제출 시각아이디문제언어결과실행 시간메모리
834063faruk비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1049 ms340 KiB
#include "biscuits.h"
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()

using namespace std;
typedef long long ll;

const ll maxsum = 1e5+1;

long long count_tastiness(long long x, std::vector<long long> a) {
	ll out = 0;
	a.resize(61);
	for (int val = 0; val < maxsum; val++) {
		vector<ll> curr = a;
		int num = 0;
		bool ok = true;
		for (ll a = 0; a < curr.size(); a++) {
			num += curr[a];
			if ((val & (1LL <<a)) != 0)
			{
				if (num < x)
					ok = false;
				else	
					num -= x;
			}
			num /= 2;
		}
		if (ok)
			out++;
	}

	return out;
}

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:17:20: 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]
   17 |   for (ll a = 0; a < curr.size(); a++) {
      |                  ~~^~~~~~~~~~~~~
#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...