• + 2 comments
    public class Solution {
    
        public static void main(String[] args) {
            /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
            int i,n;
            BigInteger a,b;
            Scanner sc=new Scanner(System.in);
            a =  sc.nextBigInteger();
            b =  sc.nextBigInteger();
            n = sc.nextInt();
            BigInteger [] val = new BigInteger[n];
            val[0] = a;
            val[1] = b;
            for(i=2;i<n;i++){
                val[i]= (val[i-1].pow(2)).add(val[i-2]);
            }
            System.out.println(val[i-1]);
        } 
    }
    
    • + 0 comments

      thanks

    • + 0 comments

      Compile time error

      Compile Message

      Solution.java:6: error: cannot find symbol BigInteger a,b; ^ symbol: class BigInteger location: class Solution Solution.java:7: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Solution Solution.java:7: error: cannot find symbol Scanner sc=new Scanner(System.in); ^ symbol: class Scanner location: class Solution Solution.java:11: error: cannot find symbol BigInteger [] val = new BigInteger[n]; ^ symbol: class BigInteger location: class Solution Solution.java:11: error: cannot find symbol BigInteger [] val = new BigInteger[n]; ^ symbol: class BigInteger location: class Solution 5 errors