/ SeriousOJ /

Record Detail

Compile Error

foo.c:1:1: error: stray '##' in program
    1 | ##include <stdio.h>
      | ^~
foo.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | ##include <stdio.h>
      |           ^
In file included from foo.c:2:
/usr/include/string.h:44:22: error: unknown type name 'size_t'
   44 |                      size_t __n) __THROW __nonnull ((1, 2));
      |                      ^~~~~~
/usr/include/string.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
   33 | #include <stddef.h>
  +++ |+#include <stddef.h>
   34 | 
/usr/include/string.h:47:56: error: unknown type name 'size_t'
   47 | extern void *memmove (void *__dest, const void *__src, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:47:56: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:61:42: error: unknown type name 'size_t'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                                          ^~~~~~
/usr/include/string.h:61:42: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:64:56: error: unknown type name 'size_t'
   64 | extern int memcmp (const void *__s1, const void *__s2, size_t __n)
      |                                                        ^~~~~~
/usr/include/string.h:64:56: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:80:60: error: unknown type name 'size_t'
   80 | extern int __memcmpeq (const void *__s1, const void *__s2, size_t __n)
      |                                                            ^~~~~~
/usr/include/string.h:80:60: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:107:48: error: unknown type name 'size_t'
  107 | extern void *memchr (const void *__s, int __c, size_t __n)
      |                                                ^~~~~~
/usr/include/string.h:107:48: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:145:53: error: unknown type name 'size_t'
  145 |                       const char *__restrict __src, size_t __n)
      |                                                     ^~~~~~
/usr/include/string.h:145:53: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:153:23: error: unknown type name 'size_t'
  153 |                       size_t __n) __THROW __nonnull ((1, 2));
      |                       ^~~~~~
/usr/include/string.h:153:23: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:159:57: error: unknown type name 'size_t'
  159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n)
      |                                                         ^~~~~~
/usr/include/string.h:159:57: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:166:8: error: unknown type name 'size_t'
  166 | extern size_t strxfrm (char *__restrict __dest,
      |        ^~~~~~
/usr/include/string.h:167:54: error: unknown type name 'size_t'
  167 |                        const char *__restrict __src, size_t __n)
      |                                                      ^~~~~~
/usr/include/string.h:167:54: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/string.h:293:8: error: unknown type name 'size_t'
  293 | extern size_t strcspn (const char *__s, const char *__reject)
      |        ^~~~~~
/usr/include/string.h:297:8: error: unknown type name 'size_t'
  297 | extern size_t strspn (const char *__s, const char *__accept)
      |        ^~~~~~
/usr/include/string.h:407:8: error: unknown type name 'size_t'
  407 | extern size_t strlen (const char *__s)
      |        ^~~~~~
In file included from /usr/include/features.h:502,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/string.h:26:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:26:1: error: unknown type name 'size_t'
   26 | __NTH (memcpy (void *__restrict __dest, const void *__restrict __src,
      | ^~~~~
In file included from /usr/include/string.h:548:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:1:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
  +++ |+#include <stddef.h>
    1 | /* Copyright (C) 2004-2024 Free Software Foundation, Inc.
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:1: error: unknown type name 'size_t'
   34 | __NTH (memmove (void *__dest, const void *__src, size_t __len))
      | ^~~~~
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:34:1: note: 'size_t' is defined in header '<stddef.h>'; did you forget to '#include <stddef.h>'?
/usr/include/x86_64-linux-gnu/bits/string_fortifi

Code

##include <stdio.h>
#include <string.h>
#define S 50000

int main() {
    int a, b;

    scanf("%d", &a);

    while (a--) {
        int roy = 0,emon = 0; 
        scanf("%d", &b);

        char x[S];
        scanf("%s", x);

        for (int i = 0; i < b; i++) {
            if (x[i] == '1') {
                emon++;
            } 
			else {
                if (emon > roy) {
                    roy = emon;
                }
                emon = 0;
            }
        }

        if (emon > roy) {
            roy = emon;
        }

        printf("%d\n", roy);
    }

    return 0;
}

Information

Submit By
Type
Pretest
Problem
P1113 Fliping Game
Language
C99 (GCC 13.2.0)
Submit At
2024-11-05 16:08:07
Judged At
2024-11-05 16:08:07
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes