Submission #102275

#TimeUsernameProblemLanguageResultExecution timeMemory
102275onjo0127Bitaro the Brave (JOI19_ho_t1)C++11
100 / 100
809 ms18040 KiB
#include <bits/stdc++.h> using namespace std; char A[3009][3009]; int se[3009], ga[3009]; int main() { int H, W; scanf("%d%d",&H,&W); for(int i=1; i<=H; i++) { for(int j=1; j<=W; j++) { scanf(" %c",&A[i][j]); } } long long ans = 0; for(int i=H; i>=1; i--) { for(int j=W; j>=1; j--) { if(A[i][j] == 'J') ans += se[j] * ga[i]; if(A[i][j] == 'I') ++se[j]; if(A[i][j] == 'O') ++ga[i]; } } printf("%lld",ans); return 0; }

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:8:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     int H, W; scanf("%d%d",&H,&W);
               ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t1.cpp:11:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf(" %c",&A[i][j]);
             ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...