제출 #589307

#제출 시각아이디문제언어결과실행 시간메모리
589307MohamedFaresNebiliBitaro the Brave (JOI19_ho_t1)C++14
0 / 100
1 ms340 KiB
#include <bits/stdc++.h> /// #pragma GCC optimize ("Ofast") /// #pragma GCC target ("avx2") /// #pragma GCC optimize("unroll-loops") using namespace std; using ll = long long; using ld = long double; using ii = pair<ll, ll>; using vi = vector<int>; #define ff first #define ss second #define pb push_back #define all(x) (x).begin(), (x).end() #define lb lower_bound #define int ll #define double ld const int MOD = 1000 * 1000 * 1000 + 7; const double EPS = 1e-9; int H, W, A[3001], B[3001]; char grid[3001][3001]; int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); cin >> H >> W; for(int l = 0; l < H; l++) for(int i = 0; i < W; i++) cin >> grid[l][i]; int res = 0; for(int l = 0; l < H; l++) for(int i = 0; i < W; i++) { if(grid[l][i] == 'O') A[l]++; if(grid[l][i] == 'I') B[i]++; } for(int l = 0; l < H; l++) for(int i = 0; i < W; i++) if(grid[l][i] == 'J') res += A[i] * B[l]; cout << res << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...