Skip to main content

Posts

Showing posts with the label uva

ACM problem submit in Java with BigInteger in uva online judge

When to use : • First of all in c,c ++ we have some problem with Big number Like 2^32 or more.This problem Can be solved by using c,c ++ ,but it is more easy or faster to use Java here. • Because Java support BigInteger And BigDecimal in java.math.BigInteger library. • Sometimes we have to generate number series like Fibonacci upto 1000.It is more easy in java to generate these without C.Where C or c++ is more complex. • Note: When time is factor it is not right to use java Library to use: • Import java.io.*; • Import java.math.BigInteger; • Import java.math.BigDecimal; • Import java.util.*; Taking Input: • For taking input Try to use Scanner. • Because it handle all space and newline itself. • Format: Scanner in = new Scanner(new BufferedReader (new InputStreamReader ( System.in ))); It will take input from Commandline . Use while( in.hasNext ())  to take every input from file or input line. After that you have to take it as BigI...