답안 #475712

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
475712 2021-09-23T18:56:43 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++)
        {
            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();
}

Compilation message

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;
      |               ^~~