제출 #415504

#제출 시각아이디문제언어결과실행 시간메모리
415504MKopchev비스킷 담기 (IOI20_biscuits)C++14
21 / 100
1100 ms63296 KiB
#include "biscuits.h" #include<bits/stdc++.h> using namespace std; const int nmax=64; long long inp[nmax],mem_x; map<long long,long long> seen[nmax]; long long rec(int bit,long long high) { if(bit==60)return 1; high=high+inp[bit]; if(seen[bit].count(high))return seen[bit][high]; long long ret=0; //0 ret=ret+rec(bit+1,high/2); //1 if(high>=mem_x)ret=ret+rec(bit+1,(high-mem_x)/2); seen[bit][high]=ret; //cout<<"f "<<bit<<" , "<<high<<" = "<<ret<<endl; return ret; } long long count_tastiness(long long x, std::vector<long long> a) { mem_x=x; for(int i=0;i<60;i++) { seen[i]={}; inp[i]=0; } for(int i=0;i<a.size();i++)inp[i]=a[i]; long long ret=rec(0,0); //for(int i=0;i<59;i++)cout<<i<<" -> "<<seen[i].size()<<endl; return ret; } /* int main() { int q; assert(scanf("%d", &q) == 1); vector<int> k(q); vector<long long> x(q); vector<vector<long long>> a(q); vector<long long> results(q); for (int t = 0; t < q; t++) { assert(scanf("%d%lld", &k[t], &x[t]) == 2); a[t] = vector<long long>(k[t]); for (int i = 0; i < k[t]; i++) { assert(scanf("%lld", &a[t][i]) == 1); } } fclose(stdin); for (int t = 0; t < q; t++) { results[t] = count_tastiness(x[t], a[t]); } for (int t = 0; t < q; t++) { printf("%lld\n", results[t]); } fclose(stdout); return 0; } */

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

biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:39:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |     for(int i=0;i<a.size();i++)inp[i]=a[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...