Submission #100752

#TimeUsernameProblemLanguageResultExecution timeMemory
100752ikura355Bitaro the Brave (JOI19_ho_t1)C++14
100 / 100
251 ms88440 KiB
#include<bits/stdc++.h> using namespace std; const int maxn = 3e3 + 5; int n,m; char s[maxn][maxn]; long long a[maxn][maxn]; int main() { //freopen("in.txt","r",stdin); //freopen("out.txt","w",stdout); scanf("%d%d",&n,&m); for(int i=1;i<=n;i++) scanf(" %s",s[i]+1); for(int i=1;i<=n;i++) { int cnt = 0; for(int j=m;j>=1;j--) { cnt += s[i][j]=='O'; a[i][j] = cnt; } } long long ans = 0; for(int j=1;j<=m;j++) { int cnt = 0; for(int i=n;i>=1;i--) { cnt += s[i][j]=='I'; if(s[i][j]=='J') ans += (long long)cnt * a[i][j]; } } printf("%lld",ans); }

Compilation message (stderr)

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