Submission #222356

# Submission time Handle Problem Language Result Execution time Memory
222356 2020-04-13T05:15:06 Z rainy ACM (COCI19_acm) C++14
10 / 50
11 ms 384 KB
#include<bits/stdc++.h>
using namespace std;
int N,M;
char tn[20];
char mt[20]="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 (*)[20]' [-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 384 KB Output isn't correct
3 Incorrect 4 ms 256 KB Output isn't correct
4 Incorrect 11 ms 256 KB Output isn't correct
5 Incorrect 11 ms 256 KB Output isn't correct