제출 #844649

#제출 시각아이디문제언어결과실행 시간메모리
844649leanchecBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
117 ms80340 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int h, w; vector<string> grid; cin >> h >> w; for(int i=0; i<h; i++){ string a; cin >> a; grid.push_back(a); } int sumO[3010][3010]={}, sumI[3010][3010]={}; long long resp=0; for(int i=h-1; i>=0; i--){ for(int j=w-1; j>=0; j--){ sumO[i][j]=sumO[i][j+1]; if(grid[i][j]=='O')sumO[i][j]++; sumI[i][j]=sumI[i+1][j]; if(grid[i][j]=='I')sumI[i][j]++; if(grid[i][j]!='J')continue; resp+=sumO[i][j]*sumI[i][j]; } } cout << resp << endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...