제출 #136757

#제출 시각아이디문제언어결과실행 시간메모리
136757KewoBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
387 ms79996 KiB
#include <bits/stdc++.h> #define pb push_back #define ppb pop_back #define fi first #define se second #define mid ((x + y) / 2) #define left (ind * 2) #define right (ind * 2 + 1) #define mp make_pair #define timer ((double)clock() / CLOCKS_PER_SEC) #define endl "\n" #define spc " " #define d1(x) cerr<<#x<<":"<<x<<endl #define d2(x, y) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<endl #define d3(x, y, z) cerr<<#x<<":"<<x<<" "<<#y<<":"<<y<<" "<<#z<<":"<<z<<endl #define fast_io() ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) using namespace std; typedef long long int lli; typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<double, double> dd; const int N = (int)(3e3 + 5); const int LOG = (int)(20); int n, m, O[N][N], I[N][N]; char s[N][N]; lli ans; int main() { fast_io(); // freopen("inp.in", "r", stdin); cin >> n >> m; for(int i = 1; i <= n; i++) cin >> s[i] + 1; for(int i = 1; i <= n; i++) for(int j = m; j >= 1; j--) O[i][j] = O[i][j + 1] + (s[i][j] == 'O'); for(int i = 1; i <= m; i++) for(int j = n; j >= 1; j--) I[j][i] = I[j + 1][i] + (s[j][i] == 'I'); for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) if(s[i][j] == 'J') ans += O[i][j] * I[i][j]; cout << ans; }

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

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:37:15: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   cin >> s[i] + 1;
          ~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...