Submission #97610

#TimeUsernameProblemLanguageResultExecution timeMemory
97610maruiiBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
129 ms79708 KiB
#include <bits/stdc++.h> using namespace std; char s[3005][3005]; int H, W, O[3005][3005], I[3005][3005]; int main(){ scanf("%d%d",&H,&W); for(int i=0; i<H; ++i) scanf("%s",s[i]); long long ans=0; for(int i=H-1; i>=0; --i) for(int j=W-1; j>=0; --j) O[i][j] = O[i][j+1]+(s[i][j]=='O'), I[i][j] = I[i+1][j]+(s[i][j]=='I'), ans += (s[i][j]=='J')*O[i][j]*I[i][j]; printf("%lld",ans); return 0; }

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:6:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&H,&W);
  ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t1.cpp:7:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i=0; i<H; ++i) scanf("%s",s[i]);
                         ~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...