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_20614067_6376.cpp:5:25: error: stray '#' in program
     using namespace std;#define mod 1000003int n;int a[1001];long long ans[1001];int sum;long long c[1001][1001];int num[33]; inline void init(){    memset(c,0,sizeof(c));    c[0][0]=1;    for(int i=1;i<=1000;i++) c[i][0]=1,c[i][i]=1;    for(int i=2;i<=1000;i++)        for(int j=1;j<i;j++)            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod; }inline void chuli(int t){    int val=t;    int s=1;    while(val)    {        if(val%2)            num[s]++;        val/=2;        s++;    }}int main(){    init();    while(~scanf("%d",&n))    {        memset(ans,0,sizeof(ans));        memset(num,0,sizeof(num));        for(int i=1;i<=n;i++)        {            scanf("%d",&a[i]);            chuli(a[i]);        }        for(int i=1;i<=n;i++)        {            for(int j=1;j<=32;j++)            {                for(int k=1;k<=i;k+=2)                    ans[i]+=(c[num[j]][k]*(c[n-num[j]][i-k])%mod)*((1*1LL)<<(j-1) %mod),ans[i]%=mod;            }        }        for(int i=1;i<=n;i++)        {            printf("%I64d",ans[i]%mod);            if(i==n)                printf("\n");            else                printf(" ");        }    }}
                         ^
0_0_20614067_6376.cpp:5:26: error: 'define' does not name a type
     using namespace std;#define mod 1000003int n;int a[1001];long long ans[1001];int sum;long long c[1001][1001];int num[33]; inline void init(){    memset(c,0,sizeof(c));    c[0][0]=1;    for(int i=1;i<=1000;i++) c[i][0]=1,c[i][i]=1;    for(int i=2;i<=1000;i++)        for(int j=1;j<i;j++)            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod; }inline void chuli(int t){    int val=t;    int s=1;    while(val)    {        if(val%2)            num[s]++;        val/=2;        s++;    }}int main(){    init();    while(~scanf("%d",&n))    {        memset(ans,0,sizeof(ans));        memset(num,0,sizeof(num));        for(int i=1;i<=n;i++)        {            scanf("%d",&a[i]);            chuli(a[i]);        }        for(int i=1;i<=n;i++)        {            for(int j=1;j<=32;j++)            {                for(int k=1;k<=i;k+=2)                    ans[i]+=(c[num[j]][k]*(c[n-num[j]][i-k])%mod)*((1*1LL)<<(j-1) %mod),ans[i]%=mod;            }        }        for(int i=1;i<=n;i++)        {            printf("%I64d",ans[i]%mod);            if(i==n)                printf("\n");            else                printf(" ");        }    }}
                          ^
0_0_20614067_6376.cpp: In function 'void init()':
0_0_20614067_6376.cpp:5:335: error: 'mod' was not declared in this scope
     using namespace std;#define mod 1000003int n;int a[1001];long long ans[1001];int sum;long long c[1001][1001];int num[33]; inline void init(){    memset(c,0,sizeof(c));    c[0][0]=1;    for(int i=1;i<=1000;i++) c[i][0]=1,c[i][i]=1;    for(int i=2;i<=1000;i++)        for(int j=1;j<i;j++)            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod; }inline void chuli(int t){    int val=t;    int s=1;    while(val)    {        if(val%2)            num[s]++;        val/=2;        s++;    }}int main(){    init();    while(~scanf("%d",&n))    {        memset(ans,0,sizeof(ans));        memset(num,0,sizeof(num));        for(int i=1;i<=n;i++)        {            scanf("%d",&a[i]);            chuli(a[i]);        }        for(int i=1;i<=n;i++)        {            for(int j=1;j<=32;j++)            {                for(int k=1;k<=i;k+=2)                    ans[i]+=(c[num[j]][k]*(c[n-num[j]][i-k])%mod)*((1*1LL)<<(j-1) %mod),ans[i]%=mod;            }        }        for(int i=1;i<=n;i++)        {            printf("%I64d",ans[i]%mod);            if(i==n)                printf("\n");            else                printf(" ");        }    }}
                                                                                                                                                                                                                                                                                                                                               ^
0_0_20614067_6376.cpp: In function 'int main()':
0_0_20614067_6376.cpp:5:527: error: 'n' was not declared in this scope
     using namespace std;#define mod 1000003int n;int a[1001];long long ans[1001];int sum;long long c[1001][1001];int num[33]; inline void init(){    memset(c,0,sizeof(c));    c[0][0]=1;    for(int i=1;i<=1000;i++) c[i][0]=1,c[i][i]=1;    for(int i=2;i<=1000;i++)        for(int j=1;j<i;j++)            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod; }inline void chuli(int t){    int val=t;    int s=1;    while(val)    {        if(val%2)            num[s]++;        val/=2;        s++;    }}int main(){    init();    while(~scanf("%d",&n))    {        memset(ans,0,sizeof(ans));        memset(num,0,sizeof(num));        for(int i=1;i<=n;i++)        {            scanf("%d",&a[i]);            chuli(a[i]);        }        for(int i=1;i<=n;i++)        {            for(int j=1;j<=32;j++)            {                for(int k=1;k<=i;k+=2)                    ans[i]+=(c[num[j]][k]*(c[n-num[j]][i-k])%mod)*((1*1LL)<<(j-1) %mod),ans[i]%=mod;            }        }        for(int i=1;i<=n;i++)        {            printf("%I64d",ans[i]%mod);            if(i==n)                printf("\n");            else                printf(" ");        }    }}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ^
0_0_20614067_6376.cpp:5:888: error: 'mod' was not declared in this scope
     using namespace std;#define mod 1000003int n;int a[1001];long long ans[1001];int sum;long long c[1001][1001];int num[33]; inline void init(){    memset(c,0,sizeof(c));    c[0][0]=1;    for(int i=1;i<=1000;i++) c[i][0]=1,c[i][i]=1;    for(int i=2;i<=1000;i++)        for(int j=1;j<i;j++)            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod; }inline void chuli(int t){    int val=t;    int s=1;    while(val)    {        if(val%2)            num[s]++;        val/=2;        s++;    }}int main(){    init();    while(~scanf("%d",&n))    {        memset(ans,0,sizeof(ans));        memset(num,0,sizeof(num));        for(int i=1;i<=n;i++)        {            scanf("%d",&a[i]);            chuli(a[i]);        }        for(int i=1;i<=n;i++)        {            for(int j=1;j<=32;j++)            {                for(int k=1;k<=i;k+=2)                    ans[i]+=(c[num[j]][k]*(c[n-num[j]][i-k])%mod)*((1*1LL)<<(j-1) %mod),ans[i]%=mod;            }        }        for(int i=1;i<=n;i++)        {            printf("%I64d",ans[i]%mod);            if(i==n)                printf("\n");            else                printf(" ");        }    }}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ^
0_0_20614067_6376.cpp:5:1021: error: 'mod' was not declared in this scope
     using namespace std;#define mod 1000003int n;int a[1001];long long ans[1001];int sum;long long c[1001][1001];int num[33]; inline void init(){    memset(c,0,sizeof(c));    c[0][0]=1;    for(int i=1;i<=1000;i++) c[i][0]=1,c[i][i]=1;    for(int i=2;i<=1000;i++)        for(int j=1;j<i;j++)            c[i][j]=(c[i-1][j-1]+c[i-1][j])%mod; }inline void chuli(int t){    int val=t;    int s=1;    while(val)    {        if(val%2)            num[s]++;        val/=2;        s++;    }}int main(){    init();    while(~scanf("%d",&n))    {        memset(ans,0,sizeof(ans));        memset(num,0,sizeof(num));        for(int i=1;i<=n;i++)        {            scanf("%d",&a[i]);            chuli(a[i]);        }        for(int i=1;i<=n;i++)        {            for(int j=1;j<=32;j++)            {                for(int k=1;k<=i;k+=2)                    ans[i]+=(c[num[j]][k]*(c[n-num[j]][i-k])%mod)*((1*1LL)<<(j-1) %mod),ans[i]%=mod;            }        }        for(int i=1;i<=n;i++)        {            printf("%I64d",ans[i]%mod);            if(i==n)                printf("\n");            else                printf(" ");        }    }}
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             ^


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-29 20:59:47, Gzip enabled