제출 #1041385

#제출 시각아이디문제언어결과실행 시간메모리
1041385vjudge1Packing Biscuits (IOI20_biscuits)C++17
42 / 100
1061 ms18412 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; unordered_map<long long,long long> dp,dp2; long long count_tastiness(long long x, std::vector<long long> a) { dp.clear(); dp2.clear(); dp[0]=1; long long ans=0; while(a.size()<60) a.push_back(0); for(auto k:a){ dp2.clear(); for(auto[i,j]:dp){ long long l=i+k; if(l>=x) dp2[l-x>>1]+=j; dp2[l>>1]+=j; } swap(dp,dp2); } for(auto i:dp) ans+=i.second; return ans; }

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:16:27: warning: suggest parentheses around '-' inside '>>' [-Wparentheses]
   16 |             if(l>=x) dp2[l-x>>1]+=j;
      |                          ~^~
#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...