Submission #717594

#TimeUsernameProblemLanguageResultExecution timeMemory
717594vjudge1Bitaro the Brave (JOI19_ho_t1)C++14
20 / 100
1082 ms3904 KiB
#include<bits/stdc++.h> using namespace std; char ma[3001][3001]; vector <pair<long long,long long >> doo; vector <pair<long long,long long >> dii; int main(){ long long n,m,i,j,ans=0; cin>>n>>m; string s; for( i=0;i<n;i++){ cin>>s; for( j=0;j<m;j++) ma[i][j]=s[j]; } for(i=0;i<n;i++){ for(int j=0;j<m;j++){ if(ma[i][j]=='O') doo.push_back({i,j}); else if(ma[i][j]=='I') dii.push_back({i,j}); } } for(pair<int,int> x:doo){ long long tw=x.first; long long tw2=x.second; for(pair<int,int> y:dii){ long long on=y.second; long long on1=y.first; if(tw2<=on||on1<=tw) continue; if(ma[tw][on]=='J') ans++; } } cout<<ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...