diff --git a/src/20241121/U504523.cpp b/src/20241121/U504523.cpp index f610952..024b5d3 100644 --- a/src/20241121/U504523.cpp +++ b/src/20241121/U504523.cpp @@ -1,4 +1,5 @@ #include +#include using namespace std; using ll =int64_t; @@ -15,8 +16,8 @@ int main(){ for(int i=0;i> a[i] >> d[i]; } - sort(a, a+n); - sort(d, d+n); + sort(execution::par, a, a+n); + sort(execution::par, d, d+n); int j = 0; int k = 0; for(int i=0;i + +using ll = int64_t; +using namespace std; + +const ll mod{ll(1e9+7)}; +ll m,q,n; + +ll fpow(ll b,ll e){ + b%=mod; + ll res{1}; + while(e!=0){ + if(e&1){ + res=res*b%mod; + } + b=b*b%mod; + e>>=1; + } + return res; +} + +int main(){ + iostream::sync_with_stdio(0),cin.tie(0),cout.tie(0); + + cin>>m>>q; + for(ll i{1};i<=q;i++){ + cin>>n; + cout< -#include -#include -#include #include -#include -#include -#include -using int64 = int64_t; - -template -void input(Args&&...args){ - (std::cin>>...>>std::forward(args)); -} - -template -std::remove_cvref_t input(){ - std::remove_cvref_t t; - std::cin>>t; - return t; -} - -template -void print(Args&&...args){ - (std::cout<<...<(args)); -} - -constexpr std::array l2 = []()constexpr->std::remove_cvref_t{ - std::remove_cvref_t ret{}; - ret[1] = 0; - for (const auto &i : std::ranges::views::iota((size_t)2, ret.size())) { - ret[i] = ret[i/2] + 1; - } - return ret; -}(); - -int64 lowbit(const int64 &num){ - return num&(-num); -} int main(){ - constexpr std::array arr{ - 1,2,3, 4, 5 - }; - std::ranges::for_each(std::ranges::views::iota((int64)1, 1ll<