This commit is contained in:
Zengtudor 2024-11-23 15:43:50 +08:00
parent 4f182335d9
commit 3c67526aab
2 changed files with 60 additions and 11 deletions

View File

@ -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

37
src/P9868/P9868.cpp Normal file
View File

@ -0,0 +1,37 @@
/*
start 2024.11.23 14:31
end ~
*/
#include <bits/stdc++.h>
#include <execution>
using namespace std;
using ll = int64_t;
const ll maxn{3000+5};
ll n,m;
string tmp,a[maxn],tmp1;
multiset<string> 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';
}