F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_29469123_14180.cpp:1:1: error: 'import' does not name a type
 import java.util.*;import java.io.*;import java.math.*; public class Main {  public static BigInteger zero=BigInteger.valueOf(0); public static BigInteger one=BigInteger.valueOf(1); public static BigInteger two=BigInteger.valueOf(2);  public static BigInteger four=BigInteger.valueOf(4); public static BigInteger six=BigInteger.valueOf(6);      public static HashMap<BigInteger,BigInteger> map=new HashMap<BigInteger,BigInteger>();  public static BigInteger solve(BigInteger n) {  if(map.containsKey(n))   return map.get(n);  BigInteger t=BigInteger.valueOf(0);  BigInteger k=n.divide(two);  BigInteger r=n.mod(two);    if(r.compareTo(one)==0)   t=solve(k).multiply(four).add(k.multiply(six));  else  {   t=two.multiply(solve(k));   t=t.add(two.multiply(solve(k.subtract(one))));   t=t.add(four.multiply(k));   t=t.subtract(four);  }  map.put(n, t);  return t; }  public static void main(String []args) {        BigInteger n;        map.put(zero, zero);        map.put(one,zero);        Scanner cin = new Scanner(System.in);         while(cin.hasNext())        {         n=cin.nextBigInteger();         System.out.println(solve(n));        } }}
 ^
0_0_29469123_14180.cpp:1:20: error: 'import' does not name a type
 import java.util.*;import java.io.*;import java.math.*; public class Main {  public static BigInteger zero=BigInteger.valueOf(0); public static BigInteger one=BigInteger.valueOf(1); public static BigInteger two=BigInteger.valueOf(2);  public static BigInteger four=BigInteger.valueOf(4); public static BigInteger six=BigInteger.valueOf(6);      public static HashMap<BigInteger,BigInteger> map=new HashMap<BigInteger,BigInteger>();  public static BigInteger solve(BigInteger n) {  if(map.containsKey(n))   return map.get(n);  BigInteger t=BigInteger.valueOf(0);  BigInteger k=n.divide(two);  BigInteger r=n.mod(two);    if(r.compareTo(one)==0)   t=solve(k).multiply(four).add(k.multiply(six));  else  {   t=two.multiply(solve(k));   t=t.add(two.multiply(solve(k.subtract(one))));   t=t.add(four.multiply(k));   t=t.subtract(four);  }  map.put(n, t);  return t; }  public static void main(String []args) {        BigInteger n;        map.put(zero, zero);        map.put(one,zero);        Scanner cin = new Scanner(System.in);         while(cin.hasNext())        {         n=cin.nextBigInteger();         System.out.println(solve(n));        } }}
                    ^
0_0_29469123_14180.cpp:1:37: error: 'import' does not name a type
 import java.util.*;import java.io.*;import java.math.*; public class Main {  public static BigInteger zero=BigInteger.valueOf(0); public static BigInteger one=BigInteger.valueOf(1); public static BigInteger two=BigInteger.valueOf(2);  public static BigInteger four=BigInteger.valueOf(4); public static BigInteger six=BigInteger.valueOf(6);      public static HashMap<BigInteger,BigInteger> map=new HashMap<BigInteger,BigInteger>();  public static BigInteger solve(BigInteger n) {  if(map.containsKey(n))   return map.get(n);  BigInteger t=BigInteger.valueOf(0);  BigInteger k=n.divide(two);  BigInteger r=n.mod(two);    if(r.compareTo(one)==0)   t=solve(k).multiply(four).add(k.multiply(six));  else  {   t=two.multiply(solve(k));   t=t.add(two.multiply(solve(k.subtract(one))));   t=t.add(four.multiply(k));   t=t.subtract(four);  }  map.put(n, t);  return t; }  public static void main(String []args) {        BigInteger n;        map.put(zero, zero);        map.put(one,zero);        Scanner cin = new Scanner(System.in);         while(cin.hasNext())        {         n=cin.nextBigInteger();         System.out.println(solve(n));        } }}
                                     ^
0_0_29469123_14180.cpp:1:57: error: expected unqualified-id before 'public'
 import java.util.*;import java.io.*;import java.math.*; public class Main {  public static BigInteger zero=BigInteger.valueOf(0); public static BigInteger one=BigInteger.valueOf(1); public static BigInteger two=BigInteger.valueOf(2);  public static BigInteger four=BigInteger.valueOf(4); public static BigInteger six=BigInteger.valueOf(6);      public static HashMap<BigInteger,BigInteger> map=new HashMap<BigInteger,BigInteger>();  public static BigInteger solve(BigInteger n) {  if(map.containsKey(n))   return map.get(n);  BigInteger t=BigInteger.valueOf(0);  BigInteger k=n.divide(two);  BigInteger r=n.mod(two);    if(r.compareTo(one)==0)   t=solve(k).multiply(four).add(k.multiply(six));  else  {   t=two.multiply(solve(k));   t=t.add(two.multiply(solve(k.subtract(one))));   t=t.add(four.multiply(k));   t=t.subtract(four);  }  map.put(n, t);  return t; }  public static void main(String []args) {        BigInteger n;        map.put(zero, zero);        map.put(one,zero);        Scanner cin = new Scanner(System.in);         while(cin.hasNext())        {         n=cin.nextBigInteger();         System.out.println(solve(n));        } }}
                                                         ^


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-17 02:01:29, Gzip enabled