-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpermugame.java
More file actions
47 lines (38 loc) · 1.25 KB
/
Copy pathpermugame.java
File metadata and controls
47 lines (38 loc) · 1.25 KB
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
package RandomCF;
import java.util.Scanner;
public class permugame {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int testcases = input.nextInt();
for(int i = 0; i< testcases; i++){
int plen = input.nextInt();
int kturn = input.nextInt();
int startB = input.nextInt();
int startS = input.nextInt();
input.nextLine();
int[] permut=new int[plen];
for(int j = 0; j<plen; j++){
permut[j]=input.nextInt();
}
int[] arr=new int[plen];
for(int k = 0; k<plen; k++){
arr[k]=input.nextInt();
}
int scoreB = score(kturn, startB, permut, arr);
int scoreS = score(kturn, startS, permut, arr);
if(scoreB>scoreS){
System.out.println("Bodya");
}else if(scoreB<scoreS){
System.out.println("Sasha");
}else{
System.out.println("Draw");
}
}
}
static int score(int kturn, int start, int[] permut, int[] arr){
int score = 0;
int pos = start;
for (int i = 1; i<kturn; i++){
}
}
}