제출 #1277001

#제출 시각아이디문제언어결과실행 시간메모리
1277001LmaoLmaoBitaro the Brave (JOI19_ho_t1)C++20
100 / 100
216 ms150400 KiB
#include<bits/stdc++.h> #define int long long #define fi first #define se second using namespace std; using ll = long long; using ii = pair<int,int>; using aa = array<int,3>; char a[3005][3005]; int O[3005][3005]; int I[3005][3005]; signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,m; cin >> n >> m; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { cin >> a[i][j]; O[i][j]=O[i][j-1]; if(a[i][j]=='O') { O[i][j]++; } I[i][j]=I[i-1][j]; if(a[i][j]=='I') { I[i][j]++; } } } int ans=0; for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { if(a[i][j]=='J') { ans+=(O[i][m]-O[i][j])*(I[n][j]-I[i][j]); } } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...