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_29469112_30719.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 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 F(BigInteger n) {  if (map.containsKey(n))   return map.get(n);  BigInteger tmp1 = n.divide(two);  BigInteger tmp2 = n.mod(two);  BigInteger tmp3 = tmp1.subtract(BigInteger.ONE);  if (tmp2.compareTo(BigInteger.ONE) == 0)   tmp1 = F(tmp1).multiply(four).add(tmp1.multiply(six));  else   tmp1 = F(tmp1).multiply(two).add(F(tmp3).multiply(two))     .add(tmp1.multiply(four)).subtract(four);  map.put(n, tmp1);  return tmp1; }  public static void main(String[] args) {  Scanner cin = new Scanner(System.in);  map.put(BigInteger.ZERO, BigInteger.ZERO);  map.put(BigInteger.ONE, BigInteger.ZERO);  while (cin.hasNext()) {   BigInteger n = cin.nextBigInteger();   System.out.println(F(n));  }  cin.close(); }}
 ^
0_0_29469112_30719.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 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 F(BigInteger n) {  if (map.containsKey(n))   return map.get(n);  BigInteger tmp1 = n.divide(two);  BigInteger tmp2 = n.mod(two);  BigInteger tmp3 = tmp1.subtract(BigInteger.ONE);  if (tmp2.compareTo(BigInteger.ONE) == 0)   tmp1 = F(tmp1).multiply(four).add(tmp1.multiply(six));  else   tmp1 = F(tmp1).multiply(two).add(F(tmp3).multiply(two))     .add(tmp1.multiply(four)).subtract(four);  map.put(n, tmp1);  return tmp1; }  public static void main(String[] args) {  Scanner cin = new Scanner(System.in);  map.put(BigInteger.ZERO, BigInteger.ZERO);  map.put(BigInteger.ONE, BigInteger.ZERO);  while (cin.hasNext()) {   BigInteger n = cin.nextBigInteger();   System.out.println(F(n));  }  cin.close(); }}
                    ^
0_0_29469112_30719.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 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 F(BigInteger n) {  if (map.containsKey(n))   return map.get(n);  BigInteger tmp1 = n.divide(two);  BigInteger tmp2 = n.mod(two);  BigInteger tmp3 = tmp1.subtract(BigInteger.ONE);  if (tmp2.compareTo(BigInteger.ONE) == 0)   tmp1 = F(tmp1).multiply(four).add(tmp1.multiply(six));  else   tmp1 = F(tmp1).multiply(two).add(F(tmp3).multiply(two))     .add(tmp1.multiply(four)).subtract(four);  map.put(n, tmp1);  return tmp1; }  public static void main(String[] args) {  Scanner cin = new Scanner(System.in);  map.put(BigInteger.ZERO, BigInteger.ZERO);  map.put(BigInteger.ONE, BigInteger.ZERO);  while (cin.hasNext()) {   BigInteger n = cin.nextBigInteger();   System.out.println(F(n));  }  cin.close(); }}
                                     ^
0_0_29469112_30719.cpp:1:57: error: expected unqualified-id before 'public'
 import java.util.*;import java.io.*;import java.math.*; public class Main {  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 F(BigInteger n) {  if (map.containsKey(n))   return map.get(n);  BigInteger tmp1 = n.divide(two);  BigInteger tmp2 = n.mod(two);  BigInteger tmp3 = tmp1.subtract(BigInteger.ONE);  if (tmp2.compareTo(BigInteger.ONE) == 0)   tmp1 = F(tmp1).multiply(four).add(tmp1.multiply(six));  else   tmp1 = F(tmp1).multiply(two).add(F(tmp3).multiply(two))     .add(tmp1.multiply(four)).subtract(four);  map.put(n, tmp1);  return tmp1; }  public static void main(String[] args) {  Scanner cin = new Scanner(System.in);  map.put(BigInteger.ZERO, BigInteger.ZERO);  map.put(BigInteger.ONE, BigInteger.ZERO);  while (cin.hasNext()) {   BigInteger n = cin.nextBigInteger();   System.out.println(F(n));  }  cin.close(); }}
                                                         ^


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-09-29 07:28:50, Gzip enabled