BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] s = br.readLine().split(" "); int n = Integer.parseInt(s[0]); int m = Integer.parseInt(s[1]); int x = Integer.parseInt(s[2]); String[] s1 = br.readLine().split(" "); Set<Integer> set = new HashSet<>(); for (int i = 0; i < n; i++){ set.add(x - Integer.parseInt(s1[i])); } String[] s2 = br.readLine().split(" "); for (int i = 0; i < m; i++){ if (set.contains(Integer.parseInt(s2[i]))){ System.out.println("YES"); return; } } System.out.println("NO");
点赞 评论

相关推荐

牛客网
牛客企业服务