Submission #2860

# Submission time Handle Problem Language Result Execution time Memory
2860 2013-08-01T01:38:35 Z naver1 간선 파괴 (GA5_destroy) C++
Compilation error
0 ms 0 KB
#include <stdio.h>

using namespace std;

int main()
{
    int i,j;
    int num;
    int num1;
    int a[701],b[701];
    scanf("%d%d",&num1,&num);
    for(i=0;i<num;i++) {
        scanf("%d%d",&a[i],&b[i]);
    }
    int num2,a1,b1,k;
    int t[1000];
    int ans[1000];
    int ans1;
    scanf("%d",&num2);
    for(i=0;i<num2;i++) {
        scanf("%d%d",&a1,&b1);
        for(j=0;j<num1;j++) {
            t[j]=j+1;
        }
        for(j=0;j<num1;j++) {
            ans[j]=0;
        }
        for(j=0;j<num;j++) {
            if(a1-1<=j && j<=b1-1) continue;
            if(a[j]>b[j]) {
                for(k=0;k<num1;k++) {
                    if(t[k]==b[j]) t[k]=a[j];
                }
            } else {
                for(k=0;k<num1;k++) {
                    if(t[k]==a[j]) t[k]=b[j];
                }
            }
        }
        for(j=0;j<num1;j++) {
            ans[t[j]-1]=1;
        }
        ans1=0;
        for(j=0;j<num1;j++) {
            if(ans[j]==1) ans1++;
        }
        printf(out,"%d\n",ans1);
    }

    return 0;
}

Compilation message

destroy.cpp: In function 'int main()':
destroy.cpp:47:16: error: 'out' was not declared in this scope
destroy.cpp:11:29: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
destroy.cpp:13:34: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
destroy.cpp:19:22: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
destroy.cpp:21:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]