Submission #2854

# Submission time Handle Problem Language Result Execution time Memory
2854 2013-07-31T23:13:00 Z naver1 속이기 (GA5_fake) C++
Compilation error
0 ms 0 KB
#include <stdio.h>

using namespace std;

int a[1001][1001];
int main()
{
    int i,j;
    int num;
    int b[1001];
    scanf("%d",&num);
    for(i=0;i<num;i++) {
        scanf("%d",&b[i]);
    }
    int max=0;
    for(i=0;i<num;i++) {
        for(j=0;;j++) {
            if(b[i]%2==0) a[i][j]=0;
            else a[i][j]=1;
            if(b[i]==1) {
                if(j>max) max=j;
                break;
            }
            b[i]=b[i]/2;
        }
    }
    int ak[1001]={0,};
    for(i=0;i<num;i++) {
        for(j=0;j<num;j++) {
            if(a[j][i]==1) a[k]++;
        }
    }
    int ck=1;
    for(i=0;i<num;i++) {
        if(a[k]%2==1) {
            ck=0;
            break;
        }
    }
    if(ck==1) printf("0");
    else printf("0");
    return 0;
}

Compilation message

fake.cpp: In function 'int main()':
fake.cpp:30:30: error: 'k' was not declared in this scope
fake.cpp:35:14: error: 'k' was not declared in this scope
fake.cpp:27:9: warning: unused variable 'ak' [-Wunused-variable]
fake.cpp:11:21: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
fake.cpp:13:26: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]