제출 #369104

#제출 시각아이디문제언어결과실행 시간메모리
369104rumen_m비스킷 담기 (IOI20_biscuits)C++17
9 / 100
1208 ms1799788 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; vector <long long> b; map <long long, long long> mp; long long solve(long long x, long long n) { if(n<=0)return 0; if(n==1)return 1; if(mp.find(n)!=mp.end()) return mp[n]; long long a = __lg(n-1); long long ans = solve(x,(1<<a)) + solve(x, min(n, b[a]/x + 1)-(1<<a)); mp[n] = ans; return ans; } long long count_tastiness(long long x, std::vector<long long> a) { long long i,j; b.clear(); mp.clear(); for(i=0;i<a.size();i++) { if(i) a[i] = a[i-1] + a[i]*(1<<i); b.push_back(a[i]); } for(i;i<=60;i++) b.push_back(b.back()); long long ans = solve(x,b.back()+1); return ans; }

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

biscuits.cpp: In function 'long long int solve(long long int, long long int)':
biscuits.cpp:10:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   10 |     if(mp.find(n)!=mp.end())
      |     ^~
biscuits.cpp:12:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   12 |         long long a = __lg(n-1);
      |         ^~~~
biscuits.cpp: In function 'long long int count_tastiness(long long int, std::vector<long long int>)':
biscuits.cpp:21:14: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(i=0;i<a.size();i++)
      |             ~^~~~~~~~~
biscuits.cpp:27:9: warning: statement has no effect [-Wunused-value]
   27 |     for(i;i<=60;i++)
      |         ^
biscuits.cpp:18:17: warning: unused variable 'j' [-Wunused-variable]
   18 |     long long i,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...