제출 #996300

#제출 시각아이디문제언어결과실행 시간메모리
996300Essa2006비스킷 담기 (IOI20_biscuits)C++14
0 / 100
16 ms600 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define FF first #define SS second #define all(a) a.begin(), aa.end() #define mod (ll)(1000000007) ll count_tastiness(ll n, vector<ll> Freq) { int sum = 100000 / n; int ans = 0; for (int i = 0; i <= sum; i++) { vector<ll> Freq2 = Freq; int j = 0; bool cant = 0; while (j < min(18, (int)Freq.size())) { if ((1 << j) & i) { if (Freq2[j] < n) { cant = 1; break; } Freq2[j] -= n; } if (j != Freq.size() - 1) { Freq2[j + 1] += Freq2[j] / 2; } j++; } ans += !cant; } return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:25:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |             if (j != Freq.size() - 1) {
      |                 ~~^~~~~~~~~~~~~~~~~~
#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...