제출 #1256139

#제출 시각아이디문제언어결과실행 시간메모리
1256139nguyenphong233Bitaro the Brave (JOI19_ho_t1)C++20
20 / 100
4 ms1864 KiB
// 23 - 12 - 23 #include<bits/stdc++.h> using namespace std; #define read() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) #define day() time_t now = time(0);char* x = ctime(&now);cerr<<"Right Now Is : "<<x<<"\n" #define ii pair<int,int> #define X first #define Y second const long long MAX = (int)3000 + 5; const long long INF = (int)1e9; const long long MOD = (int)1e9 + 7; int n,m; char a[MAX][MAX]; int O[MAX],I[MAX]; signed main(){ read(); cin >> n >> m; for(int i = 1;i <= n;i++){ for(int j = 1;j <= m;j++){ cin >> a[i][j]; } } int res = 0; for(int i = n;i >= 1;i--){ for(int j = m;j >= 1;j--){ if(a[i][j] == 'O')O[i]++; else if(a[i][j] == 'I')I[j]++; else { res = (res + O[i] * I[j]) % MOD; } } } cout << res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...