제출 #369102

#제출 시각아이디문제언어결과실행 시간메모리
369102rumen_m비스킷 담기 (IOI20_biscuits)C++17
0 / 100
1 ms620 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) { int 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<=63;i++) b.push_back(b.back()); long long ans = solve(x,b.back()+1); }

컴파일 시 표준 에러 (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: '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:18:11: warning: unused variable 'j' [-Wunused-variable]
   18 |     int i,j;
      |           ^
biscuits.cpp:29:15: warning: unused variable 'ans' [-Wunused-variable]
   29 |     long long ans = solve(x,b.back()+1);
      |               ^~~
biscuits.cpp:31:1: warning: no return statement in function returning non-void [-Wreturn-type]
   31 | }
      | ^
#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...