제출 #400347

#제출 시각아이디문제언어결과실행 시간메모리
400347REALITYNB비스킷 담기 (IOI20_biscuits)C++14
0 / 100
2 ms332 KiB
#include <bits/stdc++.h> //#include "biscuits.h" #define int long long using namespace std; int count_tastiness(int x ,vector<int> a){ int n =a.size()*2; while(a.size()!=n) a.push_back(0) ; vector<int> dp(n+1) ; dp[n]=1; for(int i=n-1;i>-1;i--){ vector<int> b = a ; int stop=i+1; for(int j=i;j<n;j++){ if(b[j]>1){ b[j+1]+=b[j]/2 ; if(b[j]&1) b[j]=1; else b[j]=0; stop=j+2; } else break ; } //cout << i << " "<< stop << endl ; for(int j=i;j<stop;j++){ if(b[j]==1){ dp[i]+=dp[stop]*(1<<(j-i)) ; } } dp[i]+=dp[i+1]; } return dp[0]-1 ; }

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

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