제출 #127443

#제출 시각아이디문제언어결과실행 시간메모리
127443arnold518Bitaro the Brave (JOI19_ho_t1)C++14
100 / 100
392 ms88824 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 3000; int N, M, O[MAXN+10][MAXN+10], I[MAXN+10][MAXN+10]; ll ans; char S[MAXN+10][MAXN+10]; int main() { int i, j; scanf("%d%d", &N, &M); for(i=1; i<=N; i++) scanf("%s", S[i]+1); for(j=1; j<=N; j++) for(i=M; i>=1; i--) O[j][i]=O[j][i+1]+(S[j][i]=='O'); for(j=1; j<=M; j++) for(i=N; i>=1; i--) I[i][j]=I[i+1][j]+(S[i][j]=='I'); for(i=1; i<=N; i++) for(j=1; j<=M; j++) { if(S[i][j]=='J') ans+=O[i][j]*I[i][j]; } printf("%lld", ans); }

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

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:18:10: 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:19:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     for(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...