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

Submission #1090582

#TimeUsernameProblemLanguageResultExecution timeMemory
1090582TlenekWodoruPacking Biscuits (IOI20_biscuits)C++17
0 / 100
3 ms348 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()<10){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...