记录详情

Runtime Error

foo.c: In function 'Selinter':
foo.c:11:29: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   11 |                         if (a[i] = b[j])
      |                             ^
foo.c:15:38: warning: statement with no effect [-Wunused-value]
   15 |                                 c[t] == a[i];
      |                                 ~~~~~^~~~~~~
foo.c: In function 'main':
foo.c:37:33: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   37 |                         scanf("%d", b[t]);
      |                                ~^   ~~~~
      |                                 |    |
      |                                 |    int
      |                                 int *
foo.c:41:30: warning: comparison between pointer and integer
   41 |                         c[j] == Selinter;
      |                              ^~
foo.c:41:30: warning: statement with no effect [-Wunused-value]
   41 |                         c[j] == Selinter;
      |                         ~~~~~^~~~~~~~~~~
foo.c:49:33: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'int' [-Wformat=]
   49 |                         scanf("%d", d[g]);
      |                                ~^   ~~~~
      |                                 |    |
      |                                 |    int
      |                                 int *
foo.c: In function 'Selinter':
foo.c:23:17: warning: 'c' is used uninitialized [-Wuninitialized]
   23 |         return c[t];
      |                ~^~~
foo.c:6:27: note: 'c' declared here
    6 |         int i, j, t = 0,  c[1000];
      |                           ^
foo.c: In function 'main':
foo.c:37:25: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized]
   37 |                         scanf("%d", b[t]);
      |                         ^~~~~~~~~~~~~~~~~
foo.c:29:23: note: 'b' declared here
   29 |         int a[10000], b[10000], c[10000], d[10000];
      |                       ^
foo.c:49:25: warning: 'd' may be used uninitialized [-Wmaybe-uninitialized]
   49 |                         scanf("%d", d[g]);
      |                         ^~~~~~~~~~~~~~~~~
foo.c:29:43: note: 'd' declared here
   29 |         int a[10000], b[10000], c[10000], d[10000];
      |                                           ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Runtime Error Segmentation fault 2ms 284.0 KiB
#2 Runtime Error Segmentation fault 2ms 284.0 KiB
#3 Runtime Error Segmentation fault 1ms 284.0 KiB
#4 Runtime Error Segmentation fault 1ms 284.0 KiB
#5 Runtime Error Segmentation fault 2ms 284.0 KiB

信息

递交者
类型
递交
题目
A10-5 集合的并集
比赛
2023 程序设计与竞赛(作业5:从数组看集体)
语言
C
递交时间
2023-10-21 23:58:25
评测时间
2023-10-21 23:58:25
评测机
分数
0
总耗时
10ms
峰值内存
284.0 KiB