From 3c67526aab3c0ff41d7877abde7ef5638d7bb05e Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Sat, 23 Nov 2024 15:43:50 +0800 Subject: [PATCH] update --- src/P8865/plant/plant1.in | 34 +++++++++++++++++++++++----------- src/P9868/P9868.cpp | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 11 deletions(-) create mode 100644 src/P9868/P9868.cpp diff --git a/src/P8865/plant/plant1.in b/src/P8865/plant/plant1.in index aee3adb..4b3f138 100644 --- a/src/P8865/plant/plant1.in +++ b/src/P8865/plant/plant1.in @@ -1,18 +1,30 @@ 3 0 -4 3 1 1 -001 -010 -000 -000 -4 3 1 1 -001 -010 -000 -000 -6 6 1 1 +16 12 1 10 +000000000001 +011111111111 +000000000011 +011111111111 +010011111111 +010111100011 +010011101111 +011111100011 +111111111111 +000011111111 +011111111111 +000000111111 +011111000111 +011111011111 +011111000111 +011111011111 +6 6 1 10 000010 011000 000110 010000 011000 000000 +4 3 1 10 +001 +010 +000 +000 \ No newline at end of file diff --git a/src/P9868/P9868.cpp b/src/P9868/P9868.cpp new file mode 100644 index 0000000..3cbaadd --- /dev/null +++ b/src/P9868/P9868.cpp @@ -0,0 +1,37 @@ +/* + start 2024.11.23 14:31 + end ~ +*/ +#include +#include +using namespace std; +using ll = int64_t; + +const ll maxn{3000+5}; +ll n,m; +string tmp,a[maxn],tmp1; +multiset b; + +int main(){ + iostream::sync_with_stdio(0),cin.tie(0),cout.tie(0); + cin>>n>>m; + for(ll i{1};i<=n;i++){ + cin>>tmp; + tmp1=tmp; + sort(execution::par,tmp1.begin(),tmp1.end()); + a[i]=std::move(tmp1); + sort(execution::par,tmp.begin(),tmp.end(),greater()); + b.emplace(std::move(tmp)); + } + + for(ll i{1};i<=n;i++){ + //第i个是b中最大的或者b中不是最小的 + if(auto it=b.lower_bound(a[i]);it==b.end()||it!=b.begin()){ + cout<<'0'; + }else{ + cout<<'1'; + } + } + cout<<'\n'; + +} \ No newline at end of file