晨三娃


私信TA

用户名:13008142306

访问量:21026

签 名:

我的语言,没有对象

等  级
排  名 389
经  验 4962
参赛次数 6
文章发表 28
年  龄 20
在职情况 学生
学  校 西华大学
专  业 计算机科学与技术

  自我简介:

解题思路:





注意事项:





参考代码:

#include <iostream>

#include <algorithm>

using namespace std;

int main ()

{

int n;

while(cin>>n){

int *p=new int [n];

int res=0;

for(int i=0;i<n;i++){

cin>>*(p+i);

}

sort(p,p+n,greater<int>());

for(int i=0;i<n;i++){

int temp;

cin>>temp;

int j;

for(j=0;j<n;j++){

if(*(p+j)<temp && *(p+j)){

res++;

*(p+j)=0;

break;

}

}

if(j==n){

for(j=n-1;j>=0;j--){

if(*(p+j) && *(p+j)==temp){

*(p+j)=0;

break;

}

}

if(j==-1) res--;

}

}

cout<<res*50<<endl;

}

return 0;

}


 

0.0分

1 人评分

  评论区