제출 #145178

#제출 시각아이디문제언어결과실행 시간메모리
145178TadijaSebezBitaro the Brave (JOI19_ho_t1)C++11
100 / 100
152 ms89848 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const int N=3050; char s[N][N]; int I[N][N],O[N][N]; int main() { int n,m; scanf("%i %i",&n,&m); for(int i=1;i<=n;i++) scanf("%s",s[i]+1); ll ans=0; for(int i=n;i>=1;i--) { for(int j=m;j>=1;j--) { O[i][j]=O[i][j+1]+(s[i][j]=='O'); I[i][j]=I[i+1][j]+(s[i][j]=='I'); if(s[i][j]=='J') ans+=(ll)O[i][j]*I[i][j]; } } printf("%lld\n",ans); return 0; }

컴파일 시 표준 에러 (stderr) 메시지

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%i %i",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:11:32: 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...