제출 #546828

#제출 시각아이디문제언어결과실행 시간메모리
546828brunnorezendes비스킷 담기 (IOI20_biscuits)C++17
0 / 100
349 ms26604 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; typedef long long int int64; typedef vector<int64> vi; set <int64> s[2]; map <pair<int,int64> , int> mp; int64 count_tastiness(int64 x, vi a){ int64 resp=0; pair<int,int64> p; s[0].insert(0); int flag=0; mp[{0, 0}] = 1; for(int i=0;i<a.size();i++){ for(auto k: s[flag]){ if(k>=(x-a[i])){ mp[{i+1, (k-(x-a[i]))/2}] += mp[{i, k}]; s[!flag].insert((k-(x-a[i]))/2); } mp[{i+1, (k+a[i])/2}] += mp[{i, k}]; s[!flag].insert((k+a[i])/2); } s[flag].clear(); flag = !flag; } for(auto k: s[flag]){ resp += mp[{a.size(), k}]; } return resp; }

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

biscuits.cpp: In function 'int64 count_tastiness(int64, vi)':
biscuits.cpp:19:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   19 |  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...