(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #1091923

#제출 시각아이디문제언어결과실행 시간메모리
1091923onlk97비스킷 담기 (IOI20_biscuits)C++14
0 / 100
2 ms520 KiB
#include "biscuits.h" #include <bits/stdc++.h> using namespace std; map <long long,long long> dp; vector <long long> ps; long long X; long long calc(long long u){ if (u<=0) return 0; if (dp.find(u)!=dp.end()) return dp[u]; long long g=__lg(u-1); return dp[u]=calc(1ll<<g)+calc(min(u,ps[g]/X+1)-(1ll<<g)); } long long count_tastiness(long long x,vector <long long> a){ dp.clear(); dp[1]=1; ps.clear(); ps.push_back(a[0]); for (int i=1; i<a.size(); i++) ps.push_back(ps.back()+(a[i]<<i)); ps.push_back(ps.back()); X=x; return calc(ps.back()/x+1); }

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

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