From 734248177e0585e125f07fda643959a32460c66b Mon Sep 17 00:00:00 2001 From: Krystian Madra Date: Thu, 28 Jun 2018 00:24:15 +0200 Subject: [PATCH] Main + input --- Main.java | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 Main.java diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..9017718 --- /dev/null +++ b/Main.java @@ -0,0 +1,42 @@ +import java.util.LinkedList; +import java.util.Queue; + +public class Main { + + public static void main(String[] args) { + + String input = args[0]; + + String[] parts = input.split(" "); + + // n + int mod = Integer.parseInt(parts[0]); + //int number = Character.getNumericValue(numberStr.charAt(0)); + + String polynomialStr = parts[1]; + + // usuwam '[', ']' + polynomialStr = polynomialStr.substring(1, polynomialStr.length()-1); + + // , + String[] polynomialNumbers = polynomialStr.split(","); + + LinkedList polynomial = new LinkedList(); + + //test poly + LinkedList polynomial2 = new LinkedList(); + + // wypelnienie wielomianu + polynomial = fill(polynomialNumbers, polynomial); + + //test + LinkedList> elements = new LinkedList>(); + elements = createCandidates(polynomial,mod); + + // Idemp + System.out.println(idempotent(elements,polynomial,mod)); + + //showPoly(polynomial); + } + +} \ No newline at end of file