Submission #154200

#TimeUsernameProblemLanguageResultExecution timeMemory
154200ivandasfsBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
173 ms88460 KiB
#include <iostream> #include <cstdio> using namespace std; char a[3005][3005]; int red[3005][3005]; int stu[3005][3005]; int main() { int n,m; scanf("%d%d", &n, &m); for (int i=0 ; i<n ; i++) { scanf("%s", a[i]); } long long sol = 0; for (int i=n-1 ; i>=0 ; i--) { for (int j=m-1 ; j>=0 ; j--) { red[i][j] = red[i][j+1] + (a[i][j] == 'O'); stu[i][j] = stu[i+1][j] + (a[i][j] == 'I'); if (a[i][j] == 'J') sol += red[i][j] * stu[i][j]; } } printf("%lld\n", sol); return 0; }

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:15:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", a[i]);
   ~~~~~^~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...