(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.

제출 #1090585

#제출 시각아이디문제언어결과실행 시간메모리
1090585TlenekWodoru비스킷 담기 (IOI20_biscuits)C++17
100 / 100
40 ms1368 KiB
#include<bits/stdc++.h> #include "biscuits.h" using namespace std; bitset<128>tab[2][128]; bitset<128>B; long long count_tastiness(long long x,vector<long long>AA) { while(AA.size()<124){AA.push_back(0);} vector<__int128>A; for(auto u : AA){A.push_back(u);} const int n=A.size(); __int128 s=0; vector<long long>dp(n); dp.push_back(1); for(int i=0;i<n;i++) { s+=A[i]*((long long)1<<i); __int128 u=s/x; if(u>=((__int128)1<<(i+1))) { for(int j=0;j<=i;j++) { tab[0][j][i]=0; tab[1][j][i]=1; } } else { for(int j=0;j<=i;j++) { if(u%2==0) { tab[0][j][i]=1; tab[1][j][i]=0; } else { tab[0][j][i]=0; tab[1][j][i]=1; } u>>=1; } } } for(int i=n-1;i>=0;i--) { if(dp[i+1]!=0) { for(int j=0;j<128;j++) { B[j]=0; } for(int j=i;j>=0;j--) { B[j]=1; if((B&tab[0][j]).count()==0) { dp[j]+=dp[i+1]; } else { B&=tab[0][j]; } } dp[0]+=dp[i+1]; } } return dp[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...