From 92c88c5e20589278c9a44527592f133011cfdcba Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Fri, 4 Oct 2024 00:10:57 +0800 Subject: [PATCH] update --- P7076/P7076.cpp | 53 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/P7076/P7076.cpp b/P7076/P7076.cpp index f5b59b7..a0bd87e 100644 --- a/P7076/P7076.cpp +++ b/P7076/P7076.cpp @@ -1,9 +1,56 @@ #include +#include +#include -using std::cin,std::cout,std::iostream; -int n,m,c,k; +using ull = unsigned long long; +using std::cin,std::cout,std::iostream,std::bitset; +ull n,m,c,k,num,input,p,q,ans {1}; +bitset<64+5> bt; + +template +class ReadNumber{ + char c; + T w,n; +public: + ReadNumber& operator>>(T &num)noexcept{ + c=(char)0,w=1,n=0; + while(!isdigit(c)){ + if constexpr(!std::is_same_v){ + if(c=='-')w=-1; + } + c = getchar(); + } + while(isdigit(c)){ + n = n*10 + (c-'0'); + c = getchar(); + } + num = w*n; + return *this; + } +}; + +ReadNumber readull; +#define cin readull int main(){ cin>>n>>m>>c>>k; - + + if(n==0 && m==0 && k==64){ + cout<<"18446744073709551616\n"; + return 0; + } + + for(ull i=0;i>input; + num |= input; + } + for(ull i=0;i>p>>q; + if(!((num>>p)&1) && !bt[p]){ + k--; + bt[p]=true; + } + } + for(int i=0;i