-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCircularWalk.java
More file actions
executable file
·32 lines (30 loc) · 906 Bytes
/
Copy pathCircularWalk.java
File metadata and controls
executable file
·32 lines (30 loc) · 906 Bytes
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
import java.io.*;
import java.util.*;
import java.math.*;
import java.text.*;
class CircularWalk
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
int numberofPointsInCircle = in.nextInt();
int startingPoint = in.nextInt();
int endingPoint = in.nextInt();
int initialArrayValue = in.nextInt();
int g = in.nextInt();
int seed = in.nextInt();
int p = in.nextInt();
int[] weightArray = new int[numberofPointsInCircle];
weightArray[0] = initialArrayValue;
for (int i=1; i< numberofPointsInCircle; i++)
{
weightArray[i] = (weightArray[i - 1] * g + seed) % p;
}
Queue<Integer> = new ArrayDeque<Integer>();
Queue.add(startingPoint);
while(!Queue.isEmpty())
{
int head = Queue.poll()
}
}
}