Submission #222357

# Submission time Handle Problem Language Result Execution time Memory
222357 2020-04-13T05:16:07 Z rainy ACM (COCI19_acm) C++14
10 / 50
11 ms 368 KB
#include<bits/stdc++.h>
using namespace std;
int N,M;
char tn[25];
char mt[25]="NijeZivotJedanACM";
int ans;

int main(){
    scanf("%d%d",&N,&M);
    for(int i=0;i<N+1;i++){
        scanf("%s",&tn);
        if(strcmp(tn,mt)==0&&i!=N)ans=i+1;
//        else printf("|%s|\n|%s|",tn,mt);
        char t='a';
        while(t!='\n')scanf("%c",&t);
    }
    printf("%d\n",ans);
    return 0;
}

Compilation message

acm.cpp: In function 'int main()':
acm.cpp:11:23: warning: format '%s' expects argument of type 'char*', but argument 2 has type 'char (*)[25]' [-Wformat=]
         scanf("%s",&tn);
                    ~~~^
acm.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&N,&M);
     ~~~~~^~~~~~~~~~~~~~
acm.cpp:11:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s",&tn);
         ~~~~~^~~~~~~~~~
acm.cpp:15:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         while(t!='\n')scanf("%c",&t);
                       ~~~~~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 5 ms 256 KB Output is correct
2 Incorrect 9 ms 256 KB Output isn't correct
3 Incorrect 5 ms 256 KB Output isn't correct
4 Incorrect 11 ms 368 KB Output isn't correct
5 Incorrect 11 ms 256 KB Output isn't correct