이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "biscuits.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll solve(ll a, ll b, ll x, vector<ll>&T, map<pair<ll,ll>,ll>&dp) {
if(a==T.size()) return b/x+1;
b+=T[a];
if(dp.find({a, b})!=dp.end()) return dp[{a, b}];
dp[{a, b}]=solve(a+1, b/2, x, T, dp);
if(b>=x) dp[{a, b}]+=solve(a+1, (b-x)/2, x, T, dp);
return dp[{a, b}];
}
ll count_tastiness(ll x, vector<ll>T) {
map<pair<ll,ll>,ll>dp;
return solve(0, 0, x, T, dp);
}
컴파일 시 표준 에러 (stderr) 메시지
biscuits.cpp: In function 'll solve(ll, ll, ll, std::vector<long long int>&, std::map<std::pair<long long int, long long int>, long long int>&)':
biscuits.cpp:6:7: 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]
6 | if(a==T.size()) return b/x+1;
| ~^~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |