/ tabris /

记录详情

Wrong Answer


  
# 状态 耗时 内存占用
#1 Accepted 2ms 304.0 KiB
#2 Accepted 2ms 304.0 KiB
#3 Wrong Answer 2ms 300.0 KiB
#4 Accepted 2ms 300.0 KiB
#5 Accepted 2ms 212.0 KiB
#6 Accepted 2ms 220.0 KiB
#7 Wrong Answer 2ms 216.0 KiB
#8 Accepted 1ms 216.0 KiB
#9 Accepted 2ms 212.0 KiB
#10 Wrong Answer 2ms 220.0 KiB

代码

#include<stdio.h>
#include<algorithm>
#include<string.h>
using namespace std;
int a[1005], b[1005], c[1005];
int main()
{
	int n, m, number = 0;
	while(scanf("%d%d", &n, &m) != EOF)
	{ 
		++number;
		int ans = 0;
		memset(c, 0, sizeof(c));
		for(int i = 0;i < n;++i)
			scanf("%d", &a[i]);
		for(int i = 0;i < m;++i)
			scanf("%d", &b[i]);
		sort(a, a + n);
		for(int i = 0;i < m;++i)
		{
			for(int j = n - 1;j >= 0;--j)
			{
				if(a[j] > b[i])
					++c[i];
				else
					break;
			} 
		}
		for(int i = 0;i < m; ++i)
		{
			if(c[i] == 0)
				++ans;
		}
		printf("Case #%d:\n",number);
		
		if(ans == 0)
		{
			printf("YES\n");
		}
		else
		{
			printf("NO\n");
		}
		for(int i = 0;i < m;++i)
		{
			printf("%d ", c[i]);
		} 
		printf("\n");
		
	}
	return 0;
}

信息

递交者
类型
递交
语言
C++
递交时间
2019-06-11 12:51:14
评测时间
2019-06-11 12:51:14
评测机
分数
70
总耗时
23ms
峰值内存
304.0 KiB