面经

Article Directory
  1. 1. 科大讯飞

面试问题

秋招招聘汇总+避雷公司8.07更新+简历指导(已指导百人)

【2023秋招&提前批】互联网招聘信息最新汇总8月8日更新

23届联想面经分享: 秋招上岸

蔚来技术岗最全面经汇总

蔚来提前批 大数据 一面二面 7.24

【通关版】招银网络科技最详面经汇总!

衫川机器人

题目

科大讯飞

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import java.util.*;
import java.util.stream.Collectors;

public class TemplateLianBiao {
// 打表测试
// 5个组两两比较,一共可以比赛十个场次
public static Deque<int[]> queue = new ArrayDeque<>();

public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int a = in.nextInt();
int[] scores = new int[5];
for (int i = 0; i < 5; i++) {
scores[i] = in.nextInt();
}
Set<List<Integer>> set = new HashSet<>();

queue.offerLast(new int[]{0, 0, 0, 0, 0});
// 0与其余比较
for (int i = 0; i < 5; i++) {
for (int j = i+1; j < 5; j++) {
int size = queue.size();
for (int k = 0; k < size; k++) {
int[] temp = queue.pollFirst();
temp[i] += 3;
temp[j] += 0;
queue.offerLast(temp.clone());
temp[i] -= 3;
temp[j] -= 0;
temp[i] += 1;
temp[j] += 1;
queue.offerLast(temp.clone());
temp[i] -= 1;
temp[j] -= 1;
temp[i] += 0;
temp[j] += 3;
queue.offerLast(temp.clone());
}
}
}

while (!queue.isEmpty()) {
int[] temp = queue.pollFirst();

Arrays.sort(temp);
for (int i = 0; i < 2; i++) {
int temoInt = temp[i];
temp[i] = temp[4-i];
temp[4-i] = temoInt;
}
set.add(Arrays.asList(temp[0], temp[1], temp[2], temp[3], temp[4]));
}

System.out.print(a == set.size() ? "yes" : "no");
System.out.print(set.contains(Arrays.asList(scores[0], scores[1], scores[2], scores[3], scores[4])) ? " yes" : " no");
}
}

Author: Jcwang

Permalink: http://example.com/2022/07/10/%E9%9D%A2%E7%BB%8F/