답안 #843956

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
843956 2023-09-04T18:04:15 Z mihaibun 축구 경기장 (IOI23_soccer) C++17
컴파일 오류
0 ms 0 KB
#include <iostream>
#include <soccer.h>
using namespace std;
int i,j,N;
int F[2001][2001];

int biggest_stadium()
{
    int i,j,x;
    for(i = 0; i < N; i++)
        for(j = 0; j < N; j++)
            if(F[i][j]==0) x++;
    return x;
}

int main()
{
  
     cin >> N;
     for(i = 0; i < N; i++)
       for(j = 0; j < N; j++)
         cin >> F[i][j];
    cout << biggest_stadium();
}

Compilation message

soccer.cpp: In function 'int biggest_stadium()':
soccer.cpp:13:12: warning: 'x' may be used uninitialized in this function [-Wmaybe-uninitialized]
   13 |     return x;
      |            ^
/usr/bin/ld: /tmp/ccKrjIio.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccLPNHOn.o:soccer.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccKrjIio.o: in function `main':
grader.cpp:(.text.startup+0x4ac): undefined reference to `biggest_stadium(int, std::vector<std::vector<int, std::allocator<int> >, std::allocator<std::vector<int, std::allocator<int> > > >)'
collect2: error: ld returned 1 exit status