제출 #1099376

#제출 시각아이디문제언어결과실행 시간메모리
1099376andreiqwerBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
134 ms88404 KiB
#include <iostream> using namespace std; int h, w; long long cntfin; int ocnts[3001][3001], icnts[3001][3001]; char s[3001][3001]; int main() { cin.tie(0); ios_base::sync_with_stdio(0); cin>>h>>w; for(int i=1; i<=h; i++) { for(int j=1; j<=w; j++) { cin>>s[i][j]; ocnts[i][j]=ocnts[i][j-1]+(s[i][j]=='O'); icnts[i][j]=icnts[i-1][j]+(s[i][j]=='I'); } } for(int i=1; i<=h; i++) { for(int j=1; j<=w; j++) { if(s[i][j]=='J') { int ocnt, icnt; ocnt=ocnts[i][w]-ocnts[i][j-1]; icnt=icnts[h][j]-icnts[i-1][j]; cntfin+=ocnt*icnt; } } } cout<<cntfin; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...