# 2020年04月25日个人赛

0
10

A – Romaji

```#include<iostream>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int main(){
string ptr;
string ar="aeiou";//云
cin>>ptr;
int f=1;
for(int i=0;i<ptr.length();i++){
if(ptr[i]!='n'&&ar.find(ptr[i])==-1){//辅音
if(ar.find(ptr[i+1])!=-1){
}else{
f=0;
break;
}
}
}
if(f==1){
cout<<"YES"<<endl;
}else{
cout<<"NO"<<endl;
}
return 0;
}```

## B – Turn the Rectangles

```#include<iostream>
#include<cstring>
#include<set>
#include<algorithm>
#define ll long long
using namespace std;int main(){
ll n;
cin>>n;
ll a,b;
cin>>a>>b;
int num=max(a,b);
ll x,y;
int f=1;
for(int i=1;i<n;i++){
cin>>x>>y;
if(x<=num&&y<=num){
num=max(x,y);
}else{
if(x<=num){
num=x;
} else if(y<=num){
num=y;
}else{
f=0;
}
}
}
if(f==0){
cout<<"NO"<<endl;
}else{
cout<<"YES"<<endl;
}
return 0;
} ```

## D – Stages

```#include<iostream>
#include<cstring>
#include<set>
#include<algorithm>
#define ll long long
using namespace std;
int main(){
int n,k;
char ptr[100],c;
cin>>n>>k;
cin>>ptr;
sort(ptr,ptr+n);
ll sum=(ptr[0]-'a'+1);
char t=ptr[0];
int num=1;
for(int i=1;i<n;i++){
if(num==k){
break;
}
if(ptr[i]-t>1){
t=ptr[i];
sum=sum+(ptr[i]-'a'+1);
num++;
}
}
if(num==k){
cout<<sum<<endl;
}else{
cout<<-1<<endl;
}
//    cout<<ptr;
return 0;
} ```

## E – Planning The Expedition

```#include<iostream>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
int main(){
int n,m,t;
cin>>n>>m/*食品袋子的总数量*/;
int num[120]={0};
int re=-1;
for(int i=0;i<m;i++){
cin>>t;
num[t]++;
re=max(re,t);
}
int temp[100]={0};
int ans=0;
for(int i=1/*每一个人所得到的数量*/;i*n<=m;i++){
int tt=1;/*第  t 种*/
for(int r=1;r<=100;r++) temp[r]=num[r];
for(int j=1;j<=n;j++){//分到第  j 个人
while(temp[tt]<i){
tt++;
if(tt>re) break;
}
temp[tt]=temp[tt]-i;
}
if(tt<=re)
ans=max(ans,i);
}
cout<<ans<<endl;
return 0;
}```

<