제출 #475712

#제출 시각아이디문제언어결과실행 시간메모리
475712soba보물 찾기 (CEOI13_treasure2)C++14
컴파일 에러
0 ms0 KiB
#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++)
        {
            cout << 1 << " " <<  1 << " "<<  i  <<  " " << j << "\n";
            cout.flush();
            cin >>cnt;
            prfx[i][j]=cnt;
            grid[i][j]=prfx[i][j]-prfx[i-1][j]-prfx[i][j-1]+prfx[i-1][j-1];
        }
    }
    cout <<"END\n"
    cout.flush();
    for(int i = 1 ; i <= N ; i++ )
    {
        for(int j  =1 ; j <= N ; j++)
        {
            cout << grid[i][j];
        }
        cout << "\n";
    }
    cout.flush();
}

컴파일 시 표준 에러 (stderr) 메시지

treasure.cpp: In function 'void findTreasure(int)':
treasure.cpp:12:13: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   12 |             cout << 1 << " " <<  1 << " "<<  i  <<  " " << j << "\n";
      |             ^~~~
      |             std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from treasure.cpp:2:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
treasure.cpp:14:13: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   14 |             cin >>cnt;
      |             ^~~
      |             std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from treasure.cpp:2:
/usr/include/c++/10/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;  /// Linked to standard input
      |                  ^~~
treasure.cpp:19:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |     cout <<"END\n"
      |     ^~~~
      |     std::cout
In file included from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:75,
                 from treasure.cpp:2:
/usr/include/c++/10/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;  /// Linked to standard output
      |                  ^~~~
treasure.cpp:7:15: warning: unused variable 'ans' [-Wunused-variable]
    7 |     int cnt , ans;
      |               ^~~