Submission #98771

#TimeUsernameProblemLanguageResultExecution timeMemory
98771bogdan10bosBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
83 ms18040 KiB
#include <bits/stdc++.h> using namespace std; //#define FILE_IO int N, M; int dwn[3005], rgt[3005]; char a[3005][3005]; int main() { #ifdef FILE_IO freopen("1.in", "r", stdin); //freopen("1.out", "w", stdout); #endif scanf("%d%d\n", &N, &M); for(int i = 1; i <= N; i++) scanf("%s\n", a[i] + 1); long long ans = 0; for(int i = N; i >= 1; i--) for(int j = M; j >= 1; j--) { rgt[j] = rgt[j + 1] + (a[i][j] == 'O'); dwn[j] += (a[i][j] == 'I'); if(a[i][j] == 'J') ans += 1LL * rgt[j] * dwn[j]; } cout << ans; return 0; }

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:18:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d\n", &N, &M);
     ~~~~~^~~~~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:20:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%s\n", a[i] + 1);
         ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...