답안 #17442

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
17442 2015-12-11T15:09:12 Z atomzeno 지우개 (GA4_eraser) C++
컴파일 오류
0 ms 0 KB
#include<stdio.h>
#define MX 110001
#include<algorithm>
using namespace std;
int n,A[MX];
long long int MOD=6000000042;
long long int a[MX],b[MX],c[MX],m,s,ss=1,ans;
int main(){
    int i,n;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&A[i]);
        long long int h=A[i];
        s=s+h;
        s%=MOD;
    }
    sort(A,A+n);
    for(i=0;i<n;i++){
        a[i]=A(long long int)[i];
    }
    m=1;
    b[1]=a[0],c[1]=1;
    for(i=1;i<n;i++){
        if(b[m]==a[i]){c[m]++;}
        else{b[++m]=a[i],c[m]++;}
    }
    ss=s;
    ss*=s;
    ss=ss%MOD;
    ss*=s;
    ss=ss%MOD;
    ans=ss;
    for(i=1;i<=m;i++){
        b[i]*=c[i];
        b[i]%=MOD;
    }
    for(i=1;i<=m;i++){
        ss=b[i]+b[i];
        ss*=b[i];
        ss=ss%MOD;
        ss*=b[i];
        ss=ss%MOD;
        ss%=MOD;
        ans+=ss;
        ans%=MOD;
    }
    for(i=1;i<=m;i++){
        ss=b[i]+b[i]+b[i];
        ss*=b[i];
        ss=ss%MOD;
        ss*=s;
        ss=ss%MOD;
        ans+=(MOD-ss);
        ans%=MOD;
    }
    long long int r=6;
    printf("%lld",ans/r);
}

Compilation message

eraser.cpp: In function ‘int main()’:
eraser.cpp:19:16: error: expected primary-expression before ‘long’
         a[i]=A(long long int)[i];
                ^
eraser.cpp:19:29: error: ‘A’ cannot be used as a function
         a[i]=A(long long int)[i];
                             ^
eraser.cpp:10:19: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d",&n);
                   ^
eraser.cpp:12:26: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d",&A[i]);
                          ^