Submission #381623

#TimeUsernameProblemLanguageResultExecution timeMemory
381623IwanttobreakfreeBitaro the Brave (JOI19_ho_t1)C++17
0 / 100
1 ms384 KiB
#include <iostream> #include <vector> using namespace std; int main(){ int h,w; cin>>h>>w; char grid[h][w]; vector<pair<int,int> > v; vector<int> ie(w,0); vector<int> o(h,0); for(int i=0;i<h;i++){ for(int j=0;j<w;j++){ cin>>grid[i][j]; if(grid[i][j]=='J')v.push_back(make_pair(i,j)); if(grid[i][j]=='I')ie[j]++; if(grid[i][j]=='O')o[i]++; } } int n=v.size(); int sol=0; for(int j=0;j<n;j++){ int x=v[j].first; int y=v[j].second; sol+=ie[x]*o[y]; } cout<<sol<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...