제출 #1127495

#제출 시각아이디문제언어결과실행 시간메모리
1127495dugersurenBitaro the Brave (JOI19_ho_t1)C++20
50 / 100
1099 ms66964 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; ll H,W; vector<pair<ll,ll>*> R[3001],C[3001]; pair<ll,ll> V[3001][3001]; char c; pair<ll,ll>* tmp; int main() { ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); cin>>H>>W; for(ll i=0;i<H;i++) for(ll j=0;j<W;j++){ cin>>c; if(c=='J'){ R[i].push_back(&V[i][j]); C[j].push_back(&V[i][j]); //cout<<R[i].back()->first<<" "<<R[i].back()->second<<"\n"; } if(c=='O'){ for(auto &it:R[i]) it->first+=1; } if(c=='I'){ for(auto &it:C[j]) it->second+=1; } } ll cnt=0; for(ll i=0;i<H;i++) for(auto it:R[i]) cnt+=it->first * it->second; cout<<cnt; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...