Language: C++

2:40 AtCoderホームへ戻る
 トップ
 問題
 質問
 提出
 提出一覧
 順位表
 コードテスト
提出 #2467021

ソースコード 

Copy
Copy
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <queue>
#include <stack>
#include <list>
#include <functional>
#include <numeric>
#include <iostream>
 
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
 
int main(){
  int H, W;
  char S[123][123];
  scanf("%d %d", &H, &W);
  rep(i, H) scanf("%s", &S[i]);
  bool can = true;
  rep(i, H) rep(j, W){
    if(S[i][j] == '#'){
      if((i == 0 || S[i - 1][j] == '.') &&
         (i == H || S[i + 1][j] == '.') &&
         (j == 0 || S[i][j - 1] == '.') &&
         (j == W || S[i][j + 1] == '.')) can = false;
    }
  }
  if(can) printf("Yes\n");
  else printf("No\n");
  
  return 0;
}

Compiler output:
a.cc:9:6: error: stray '#' in program
    9 | 提出 #2467021
      |      ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 2:40 AtCoderホームへ戻る
      | ^
In file included from a.cc:16:
/usr/include/string.h:44:22: error: 'size_t' has not been declared
   44 |                      size_t __n) __THROW __nonnull ((1, 2));
      |                      ^~~~~~
/usr/include/string.h:47:56: error: 'size_t' has not been declared
   47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:55:32: error: 'size_t' has not been declared
   55 |                       int __c, size_t __n)
      |                                ^~~~~~
/usr/include/string.h:61:42: error: 'size_t' has not been declared
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                          ^~~~~~
/usr/include/string.h:64:56: error: 'size_t' has not been declared
   64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:80:60: error: 'size_t' has not been declared
   80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
      |                                                            ^~~~~~
/usr/include/string.h:87:42: error: 'size_t' has not been declared
   87 | extern void *memchr (void *__s, int __c, size_t __n)
      |                                          ^~~~~~
/usr/include/string.h:89:54: error: 'size_t' has not been declared
   89 | extern const void *memchr (const void *__s, int __c, size_t __n)
      |                                                      ^~~~~~
/usr/include/string.h:126:49: error: 'size_t' has not been declared
  126 | extern "C++" void *memrchr (void *__s, int __c, size_t __n)
      |                                                 ^~~~~~
/usr/include/string.h:129:61: error: 'size_t' has not been declared
  129 | extern "C++" const void *memrchr (const void *__s, int __c, size_t __n)
      |                                                             ^~~~~~
/usr/include/string.h:145:53: error: 'size_t' has not been declared
  145 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:153:23: error: 'size_t' has not been declared
  153 |                       size_t __n) __THROW __nonnull ((1, 2));
      |                       ^~~~~~
/usr/include/string.h:159:57: error: 'size_t' has not been declared
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |                                                         ^~~~~~
/usr/include/string.h:166:8: error: 'size_t' does not name a type
  166 | extern size_t strxfrm (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:34:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   33 | #include <stddef.h>
  +++ |+#include <cstddef>
   34 | 
/usr/include/string.h:179:8: error: 'size_t' does not name a type
  179 | extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
      |        ^~~~~~
/usr/include/string.h:179:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:195:45: error: 'size_t' has not been declared
  195 | extern char *strndup (const char *__string, size_t __n)
      |                                             ^~~~~~
/usr/include/string.h:293:8: error: 'size_t' does not name a type
  293 | extern size_t strcspn (const char *__s, const char *__reject)
      |        ^~~~~~
/usr/include/string.h:293:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:297:8: error: 'size_t' does not name a type
  297 | extern size_t strspn (const char *__s, const char *__accept)
      |        ^~~~~~
/usr/include/string.h:297:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:389:46: error: 'size_t' has not been declared
  389 | extern void *memmem (const void *__haystack, size_t __haystacklen,
      |                                              ^~~~~~
/usr/include/string.h:390:44: error: 'size_t' has not been declared
  390 |                      const void *__needle, size_t __needlelen)
      |                                            ^~~~~~
/usr/include/string.h:398:55: error: 'size_t' has not been declared
  398 |                         const void *__restrict __src, size_t __n)
      |                                                       ^~~~~~
/usr/include/string.h:401:53: error: 'size_t' has not been declared
  401 |                       const void *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:407:8: error: 'size_t' does not name a type
  407 | extern size_t strlen (const char *__s)
      |        ^~~~~~
/usr/include/string.h:407:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:413:8: error: 'size_t' does not name a type
  413 | extern size_t strnlen (const char *__string, size_t __maxlen)
      |        ^~~~~~
/usr/include/string.h:413:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:444:53: error: 'size_t' has not been declared
  444 | extern char *strerror_r (int __errnum, char *__buf, size_t __buflen)
      |                                                     ^~~~~~
In file included from /usr/include/string.h:462:
/usr/include/strings.h:34:54: error: 'size_t' has not been declared
   34 | extern int bcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                      ^~~~~~
/usr/include/strings.h:38:53: error: 'size_t' has not been declared
   38 | extern void bcopy (const void *__src, void *__dest, size_t __n)
      |                                                     ^~~~~~
/usr/include/strings.h:42:31: error: 'size_t' has not been declared
   42 | extern void bzero (void *__s, size_t __n) __THROW __nonnull ((1));
      |                               ^~~~~~
/usr/include/strings.h:120:61: error: 'size_t' has not been declared
  120 | extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
      |                                                             ^~~~~~
/usr/include/strings.h:134:27: error: 'size_t' has not been declared
  134 |                           size_t __n, locale_t __loc)
      |                           ^~~~~~
/usr/include/string.h:466:40: error: 'size_t' has not been declared
  466 | extern void explicit_bzero (void *__s, size_t __n) __THROW __nonnull ((1))
      |                                        ^~~~~~
/usr/include/string.h:497:55: error: 'size_t' has not been declared
  497 |                         const char *__restrict __src, size_t __n)
      |                                                       ^~~~~~
/usr/include/string.h:500:53: error: 'size_t' has not been declared
  500 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:506:8: error: 'size_t' does not name a type
  506 | extern size_t strlcpy (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:506:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:512:8: error: 'size_t' does not name a type
  512 | extern size_t strlcat (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:512:8: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
/usr/include/string.h:526:34: error: 'size_t' has not been declared
  526 | extern void *memfrob (void *__s, size_t __n) __THROW __nonnull ((1))
      |                                  ^~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/bits/stl_algo.h:71,
                 from /usr/include/c++/14/algorithm:61,
                 from a.cc:17:
/usr/include/stdlib.h:98:8: error: 'size_t' does not name a type
   98 | extern size_t __ctype_get_mb_cur_max (void) __THROW __wur;
      |        ^~~~~~
/usr/include/stdlib.h:42:1: note: 'size_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
   41 | # include <bits/waitstatus.h>
  +++ |+#include <cstddef>
   42 | 
/usr/include/stdlib.h:278:36: error: 'size_t' has not been declared
  278 | extern int strfromd (char *__dest, size_t __size, const char *__format,
      |                                    ^~~~~~
/usr/include/stdlib.h:282:36: error: 'size_t' has not been declared
  282 | extern int strfromf (char *__dest, size_t __size, const char *__format,
      |                                    ^~~~~~
/usr/include/stdlib.h:286:36: error: 'size_t' has not been declared
  286 | extern int strfroml (char *__dest, size_t __size, const char *__format,
      |                                    ^~~~~~
/usr/include/stdlib.h:298:38: error: 'size_t' has not been declared
  298 | extern int strfromf32 (char *__dest, size_t __size, const char * __format,
      |                                      ^~~~~~
/usr/include/stdlib.h:304:38: error: 'size_t' has not been declared
  304 | extern int strfromf64 (char *__dest, size_t __size, const char * __format,
      |                                      ^~~~~~
/usr/include/stdlib.h:310:39: error: 'size_t' has not been declared
  310 | extern int strfromf128 (char *__dest, size_t __size, const char * __format,
      |                                       ^~~~~~
/usr/include/stdlib.h:316:39: error: 'size_t' has not been declared
  316 | extern int strfromf32x (char *__dest, size_t __size, const char * __format,
      |                                       ^~~~~~
/usr/include/stdli