답안 #475714

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
475714 2021-09-23T19:10:54 Z soba 보물 찾기 (CEOI13_treasure2) C++14
컴파일 오류
0 ms 0 KB
#include "treasure.h"
#include <bits/stdc++.h>
#include "grader.c"
void findTreasure (int N) {
    int grid[N+1][N+1];
    int prfx[N+1][N+1]={0};
    int cnt , ans;
    for(int i = 1 ; i <=N ; i++)
    {
        for(int j = 1 ; j <= N ; j++)
        {
            cnt=countTreasure(1,1,i,j);
            prfx[i][j]=cnt;
            grid[i][j]=prfx[i][j]-prfx[i-1][j]-prfx[i][j-1]+prfx[i-1][j-1];
        }
    }
    for(int i = 1 ; i <= N ; i++ )
    {
        for(int j  =1 ; j <= N ; j++)
        {
            if(grid[i][j]==1)
                Report(i, j);
        }
    }
}

Compilation message

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:7:15: warning: unused variable 'ans' [-Wunused-variable]
    7 |     int cnt , ans;
      |               ^~~
/usr/bin/ld: /tmp/ccmcwqNF.o: in function `my_assert(int, char const*)':
treasure.cpp:(.text+0x40): multiple definition of `my_assert(int, char const*)'; /tmp/cc6622TG.o:grader.c:(.text+0x40): first defined here
/usr/bin/ld: /tmp/ccmcwqNF.o: in function `countTreasure(int, int, int, int)':
treasure.cpp:(.text+0x90): multiple definition of `countTreasure(int, int, int, int)'; /tmp/cc6622TG.o:grader.c:(.text+0x90): first defined here
/usr/bin/ld: /tmp/ccmcwqNF.o: in function `Report(int, int)':
treasure.cpp:(.text+0x1b0): multiple definition of `Report(int, int)'; /tmp/cc6622TG.o:grader.c:(.text+0x1b0): first defined here
/usr/bin/ld: /tmp/ccmcwqNF.o: in function `main':
treasure.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc6622TG.o:grader.c:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status