Submission #1099366

#TimeUsernameProblemLanguageResultExecution timeMemory
1099366andreiqwerBitaro the Brave (JOI19_ho_t1)C++17
50 / 100
1076 ms9044 KiB
#include <iostream> using namespace std; int h, w; long long cntfin; int ocnts[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]; if(s[i][j]=='O') ocnts[i]++; } } for(int i=1; i<=h; i++) { for(int j=1; j<=w; j++) { if(s[i][j]=='O') ocnts[i]--; if(s[i][j]=='J') { int icnt=0; for(int k=i+1; k<=h; k++) { if(s[k][j]=='I') icnt++; } cntfin+=ocnts[i]*icnt; } } } cout<<cntfin; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...