제출 #500539

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
5005392021-12-31 10:10:09LittleCubeWorm Worries (BOI18_worm)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
#define int long long
std::map<int, int> arr;
int N, M, K, Q;
int query(int x, int y, int z)
{
if (1 <= x && x <= N && 1 <= y && y <= M && 1 <= z && z <= K && arr[x * (M * K) + y * K + z] == 0)
{
printf("? %d %d %d\n", x, y, z);
fflush(stdout);
int ans = -1;
(void)scanf("%d", &ans);
if (ans == -1)
exit(0);
arr[x * (M * K) + y * K + z] = ans;
}
return arr[x];
}
void guess(int x, int y, int z)
{
printf("! %d %d %d\n", x, y, z);
exit(0);
}
const double phi = 0.618033988749894848204586;
std::mt19937 rd(std::chrono::steady_clock::now().time_since_epoch().count());
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

worm.cpp: In function 'long long int query(long long int, long long int, long long int)':
worm.cpp:11:20: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   11 |         printf("? %d %d %d\n", x, y, z);
      |                   ~^           ~
      |                    |           |
      |                    int         long long int
      |                   %lld
worm.cpp:11:23: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
   11 |         printf("? %d %d %d\n", x, y, z);
      |                      ~^           ~
      |                       |           |
      |                       int         long long int
      |                      %lld
worm.cpp:11:26: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
   11 |         printf("? %d %d %d\n", x, y, z);
      |                         ~^           ~
      |                          |           |
      |                          int         long long int
      |                         %lld
worm.cpp:14:23: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   14 |         (void)scanf("%d", &ans);
      |                      ~^   ~~~~
      |                       |   |
      |                       |   long long int*
      |                       int*
      |                      %lld
worm.cpp: In function 'void guess(long long int, long long int, long long int)':
worm.cpp:24:16: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
   24 |     printf("! %d %d %d\n", x, y, z);
      |               ~^           ~
      |                |           |
      |                int         long long int
      |               %lld
worm.cpp:24:19: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long long int' [-Wformat=]
   24 |     printf("! %d %d %d\n", x, y, z);
      |                  ~^           ~
      |                   |           |
      |                   int         long long int
      |                  %lld
worm.cpp:24:22: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long long int' [-Wformat=]
   24 |     printf("! %d %d %d\n", x, y, z);
      |                     ~^           ~
      |                      |           |
      |                      int         long long int
      |                     %lld
At global scope:
cc1plus: error: '::main' must return 'int'
worm.cpp: In function 'int main()':
worm.cpp:33:19: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   33 |     (void)scanf("%d %d %d %d", &N, &M, &K, &Q);
      |                  ~^            ~~
      |                   |            |
      |                   int*         long long int*
      |                  %lld
worm.cpp:33:22: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   33 |     (void)scanf("%d %d %d %d", &N, &M, &K, &Q);
      |                     ~^             ~~
      |                      |             |
      |                      int*          long long int*
      |                     %lld
worm.cpp:33:25: warning: format '%d' expects argument of type 'int*', but argument 4 has type 'long long int*' [-Wformat=]
   33 |     (void)scanf("%d %d %d %d", &N, &M, &K, &Q);
      |                        ~^              ~~
      |                         |              |
      |                         int*           long long int*
      |                        %lld
worm.cpp:33:28: warning: format '%d' expects argument of type 'int*', but argument 5 has type 'long long int*' [-Wformat=]
   33 |     (void)scanf("%d %d %d %d", &N, &M, &K, &Q);
      |                           ~^               ~~
      |                            |               |
      |                            int*            long long int*
      |                           %lld
worm.cpp: In function 'long long int query(long long int, long long int, long long int)':
worm.cpp:14:20: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         (void)scanf("%d", &ans);
      |               ~~~~~^~~~~~~~~~~~
worm.cpp: In function 'int main()':
worm.cpp:33:16: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   33 |     (void)scanf("%d %d %d %d", &N, &M, &K, &Q);
      |           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~