From 02a4aabd9e0829a55fecf8516a1aab0dd9c1efb4 Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Thu, 14 Nov 2024 13:50:09 +0800 Subject: [PATCH] update --- src/20241113/T538697.cpp | 58 ++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 17 deletions(-) diff --git a/src/20241113/T538697.cpp b/src/20241113/T538697.cpp index f061f1a..bc48b24 100644 --- a/src/20241113/T538697.cpp +++ b/src/20241113/T538697.cpp @@ -1,4 +1,6 @@ +#include #include +#include #include using ll = int64_t; @@ -6,33 +8,55 @@ using ll = int64_t; auto &ci = std::cin; auto &co = std::cout; -const ll mn = 1e6+5; -ll n; -ll *a = new ll[mn], *sa = new ll[mn]; +const ll mxn = 1e6+5; +ll *a{new ll[mxn]}, *fcts{new ll[mxn]}, *mnfct{new ll[mxn]}; +auto ispm = new bool[mxn]; ll lb(ll n){ return n&(-n); } - int main(){ + ll n; ci>>n; - for(ll i{1};i<=n;i++){ + ll mxa{}; + for(ll i{0};i>a[i]; + mxa = std::max(mxa, a[i]); } - for(ll i{1};i<(1<<(n));i++){ - ll now{i}; - ll san{}; - for(ll j{0};j<=n;j++){ - if((1<