Submission #445672

#TimeUsernameProblemLanguageResultExecution timeMemory
445672aris12345678Awesome Arrowland Adventure (eJOI19_adventure)C++14
22 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = 505; char str[mxN][mxN]; int main() { int n, m; scanf("%d %d\n", &n, &m); int ok = 0, ans = 0; for(int i = 0; i < n; i++) { for(int j = 0; j < m; j++) { scanf("%c", &str[i][j]); if(str[i][j] == 'X') ok++; if(str[i][j] == 'N') ans++; if(str[i][j] == 'S') ans += 3; if(str[i][j] == 'W') ans += 2; } } if(ok == 1) printf("%d\n", ans); else printf("-1\n"); return 0; }

Compilation message (stderr)

adventure.cpp: In function 'int main()':
adventure.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |     scanf("%d %d\n", &n, &m);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
adventure.cpp:13:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |             scanf("%c", &str[i][j]);
      |             ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...