Submission #111950

#TimeUsernameProblemLanguageResultExecution timeMemory
111950LawlietBitaro the Brave (JOI19_ho_t1)C++14
50 / 100
566 ms30816 KiB
#include <bits/stdc++.h> #define MAX 1010 using namespace std; typedef long long int lli; int n, m; lli ans; lli sO[MAX][MAX]; lli sI[MAX][MAX]; char v[MAX][MAX]; int main() { scanf("%d %d",&n,&m); for(int g = 1 ; g <= n ; g++) for(int h = 1 ; h <= m ; h++) scanf(" %c",&v[g][h]); for(int g = 1 ; g <= n ; g++) for(int h = m ; h > 0 ; h--) sO[g][h] = sO[g][h + 1] + ((v[g][h] == 'O') ? 1 : 0); for(int g = n ; g > 0 ; g--) for(int h = 1 ; h <= m ; h++) sI[g][h] = sI[g + 1][h] + ((v[g][h] == 'I') ? 1 : 0); for(int g = 1 ; g <= n ; g++) for(int h = 1 ; h <= m ; h++) if(v[g][h] == 'J') ans += sO[g][h] * sI[g][h]; printf("%lld\n",ans); }

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:19: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:23:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
    scanf(" %c",&v[g][h]);
    ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...