제출 #773805

#제출 시각아이디문제언어결과실행 시간메모리
773805t6twotwo비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1083 ms340 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; using ll = long long; ll count_tastiness(ll q, vector<ll> A) { if (q == 1) { map<ll, ll> mp; mp[0] = 1; for (int i = 0; i < A.size(); i++) { map<ll, ll> t; for (auto [add, x] : mp) { t[(A[i] + add) / 2] += x; if (A[i] + add >= q) { t[(A[i] + add - q) / 2] += x; } } swap(mp, t); } ll ans = 0; for (auto [_, x] : mp) { ans += x; } return ans; } A.resize(61); int ans = 0; for (ll i = 0; i <= 100000; i++) { auto B = A; ans++; for (int j = 0; j < 60; j++) { if (i >> j & 1) { if (B[j] < q) { ans--; break; } B[j] -= q; } B[j + 1] += B[j] / 2; } } return ans; }

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

biscuits.cpp: In function 'll count_tastiness(ll, std::vector<long long int>)':
biscuits.cpp:9:27: 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...