比赛 202110省实验桐柏一中普及组联赛 评测结果 AAAAAAAAAA
题目名称 Killer 最终得分 100
用户昵称 PYD1 运行时间 0.000 s
代码语言 C++ 内存使用 0.00 MiB
提交时间 2021-10-18 19:01:03
显示代码纯文本
#include <cstdio>
#include <stdio.h>
#include <stdlib.h>

using namespace std;

inline int read(){
	int t = 0,f = 1;
	register char c = getchar();
	while (c < 48 || c > 57) f = (c == '-') ? (-1) : (f),c = getchar();
	while (c >= 48 && c <= 57) t = (t << 1) + (t << 3) + (c ^ 48),c = getchar();
	return f * t;
}

int m,n,r,a[101],b[101];

int main(){
	freopen("killer.in","r",stdin);
	freopen("killer.out","w",stdout);
	m = read(),n = read(),r = read();
	for (int i = 1;i <= m;i++) a[i] = read();
	for (int i = 1;i <= n;i++){
		b[i] = read();
		int tmp = 0;
		for (int j = 1;j <= m;j++){
			if (!(b[i] % a[j])) ++tmp;
		}
		b[i] = tmp;
		if (tmp == m){
			printf("%d\n",i);
			return 0;
		}
	}
	bool flag = 0;
	for (int i = 1;i <= n;i++){
		if (b[i] >= r) flag = 1,printf("%d ",i);
	}
	if (!flag) printf("0\n");
	return 0;
}