제출 #1286176

#제출 시각아이디문제언어결과실행 시간메모리
1286176lyra_g13Square or Rectangle? (NOI19_squarerect)C++20
컴파일 에러
0 ms0 KiB
#include "squarerect.h" using ll = long long; #include <bits/stdc++.h> using namespace std; bool am_i_square(int N, int Q) { std::vector<std::vector<ll>> adj(n , std::vector<ll>(n)); for(int i = 0 ; i < N ; i++){ for(int j = 0 ; j < N ; j++){ adj[i][j] = inside shape(i+1, j+1); } } ll l = 0; ll ll = 0; ll b = 0; ll bb = 0; for(int i = 0 ; i < N , l <=0; i++){ for(int j = 0 ; j < N ; j++){ (adj[i][j] == 0)continue; if(adj[i][j] == 1) ll++; } l = ll; } for(int i = 0 ; i < N , b <=0; i++){ for(int j = 0 ; j < N ; j++){ (adj[j][i] == 0)continue; if(adj[j][i] == 1) bb++; } b = bb; } if(l == b){ return 1; } else{ return 0; } }

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

squarerect.cpp: In function 'bool am_i_square(int, int)':
squarerect.cpp:8:38: error: 'n' was not declared in this scope
    8 |     std::vector<std::vector<ll>> adj(n , std::vector<ll>(n));
      |                                      ^
squarerect.cpp:11:25: error: 'inside' was not declared in this scope; did you mean 'inline'?
   11 |             adj[i][j] = inside shape(i+1, j+1);
      |                         ^~~~~~
      |                         inline
squarerect.cpp:17:3: error: expected ';' before 'b'
   17 | ll b = 0;
      |   ^~
      |   ;
squarerect.cpp:18:3: error: expected ';' before 'bb'
   18 | ll bb = 0;
      |   ^~~
      |   ;
squarerect.cpp:21:29: error: expected ';' before 'continue'
   21 |             (adj[i][j] == 0)continue;
      |                             ^~~~~~~~
      |                             ;
squarerect.cpp:28:33: error: 'b' was not declared in this scope
   28 |         for(int i = 0 ; i < N , b <=0; i++){
      |                                 ^
squarerect.cpp:30:29: error: expected ';' before 'continue'
   30 |             (adj[j][i] == 0)continue;
      |                             ^~~~~~~~
      |                             ;
squarerect.cpp:31:32: error: 'bb' was not declared in this scope
   31 |             if(adj[j][i] == 1) bb++;
      |                                ^~
squarerect.cpp:34:9: error: 'bb' was not declared in this scope
   34 |     b = bb;
      |         ^~
squarerect.cpp:37:12: error: 'b' was not declared in this scope
   37 |    if(l == b){
      |            ^
squarerect.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^