Submission #337576

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3375762020-12-21 06:49:21seedkin올림픽 피자 (tutorial5)C11
Compilation error
0 ms0 KiB
#include "pizza.h"
struct Order {
int next;
int needCnt;
int need[8];
};
int order_num;
int material[8];
int allMate;
struct Order order[100000];
int root[256];
int last[256];
int check() {
for(int i =0; i < needCnt; i++) {
if(material[need[i]] == 0) return 0;
}
return 1;
}
int makeMate(int N, int *A) {
int r = 0;
for(int i =0;i < N; i++) {
r |= (1 << A[i]);
}
return r;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

grader.c: In function 'main':
grader.c:65:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
tutorial5.c: In function 'check':
tutorial5.c:17:21: error: 'needCnt' undeclared (first use in this function)
   17 |   for(int i =0; i < needCnt; i++) {
      |                     ^~~~~~~
tutorial5.c:17:21: note: each undeclared identifier is reported only once for each function it appears in
tutorial5.c:18:17: error: 'need' undeclared (first use in this function)
   18 |     if(material[need[i]] == 0) return 0;
      |                 ^~~~
tutorial5.c: In function 'Order':
tutorial5.c:55:22: warning: passing argument 1 of 'makeMate' makes integer from pointer without a cast [-Wint-conversion]
   55 |   int idx = makeMate(A, N);
      |                      ^
      |                      |
      |                      int *
tutorial5.c:23:18: note: expected 'int' but argument is of type 'int *'
   23 | int makeMate(int N, int *A) {
      |              ~~~~^
tutorial5.c:55:25: warning: passing argument 2 of 'makeMate' makes pointer from integer without a cast [-Wint-conversion]
   55 |   int idx = makeMate(A, N);
      |                         ^
      |                         |
      |                         int
tutorial5.c:23:26: note: expected 'int *' but argument is of type 'int'
   23 | int makeMate(int N, int *A) {
      |                     ~~~~~^
tutorial5.c:56:20: warning: self-comparison always evaluates to true [-Wtautological-compare]
   56 |   if(allMate & idx == idx) {
      |                    ^~
tutorial5.c:56:20: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   56 |   if(allMate & idx == idx) {
      |                ~~~~^~~~~~
tutorial5.c: In function 'Delivery':
tutorial5.c:95:20: warning: self-comparison always evaluates to false [-Wtautological-compare]
   95 |     if(allMate & i != i) continue;
      |                    ^~
tutorial5.c:95:20: warning: suggest parentheses around comparison in operand of '&' [-Wparentheses]
   95 |     if(allMate & i != i) continue;
      |                  ~~^~~~
tutorial5.c:102:3: warning: implicit declaration of function 'bake'; did you mean 'Bake'? [-Wimplicit-function-declaration]
  102 |   bake(targetNum);
      |   ^~~~
      |   Bake