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_29469414_21023.cpp:1:1: error: 'import' does not name a type
 import java.util.Scanner;import java.math.BigInteger; public class Main {    public static void main(String[] args) {         Scanner cin =  new Scanner(System.in);         BigInteger[] a;        a = new BigInteger[3017];        int t, n;         t = cin.nextInt();          while(t--){            n = cin.nextInt();             for (int i = 0; i < n; i++)                a[i] = cin.nextBigInteger();                        BigInteger ans = BigInteger.ZERO;            BigInteger c =  BigInteger.ONE;              for (int i = 0; i < n; i++) {                BigInteger tmp = c.multiply(a[n-i-1]);                 if (i%2 == 0)                    ans = ans.add(tmp);                else                    ans = ans.subtract(tmp);                 tmp = c.multiply(BigInteger.valueOf(n-i-1));                c = tmp.divide(BigInteger.valueOf(i+1));            }             System.out.println(ans);        }    } }
 ^
0_0_29469414_21023.cpp:1:26: error: 'import' does not name a type
 import java.util.Scanner;import java.math.BigInteger; public class Main {    public static void main(String[] args) {         Scanner cin =  new Scanner(System.in);         BigInteger[] a;        a = new BigInteger[3017];        int t, n;         t = cin.nextInt();          while(t--){            n = cin.nextInt();             for (int i = 0; i < n; i++)                a[i] = cin.nextBigInteger();                        BigInteger ans = BigInteger.ZERO;            BigInteger c =  BigInteger.ONE;              for (int i = 0; i < n; i++) {                BigInteger tmp = c.multiply(a[n-i-1]);                 if (i%2 == 0)                    ans = ans.add(tmp);                else                    ans = ans.subtract(tmp);                 tmp = c.multiply(BigInteger.valueOf(n-i-1));                c = tmp.divide(BigInteger.valueOf(i+1));            }             System.out.println(ans);        }    } }
                          ^
0_0_29469414_21023.cpp:1:55: error: expected unqualified-id before 'public'
 import java.util.Scanner;import java.math.BigInteger; public class Main {    public static void main(String[] args) {         Scanner cin =  new Scanner(System.in);         BigInteger[] a;        a = new BigInteger[3017];        int t, n;         t = cin.nextInt();          while(t--){            n = cin.nextInt();             for (int i = 0; i < n; i++)                a[i] = cin.nextBigInteger();                        BigInteger ans = BigInteger.ZERO;            BigInteger c =  BigInteger.ONE;              for (int i = 0; i < n; i++) {                BigInteger tmp = c.multiply(a[n-i-1]);                 if (i%2 == 0)                    ans = ans.add(tmp);                else                    ans = ans.subtract(tmp);                 tmp = c.multiply(BigInteger.valueOf(n-i-1));                c = tmp.divide(BigInteger.valueOf(i+1));            }             System.out.println(ans);        }    } }
                                                       ^


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-06-26 23:40:53, Gzip enabled