Submission #997902

#TimeUsernameProblemLanguageResultExecution timeMemory
997902elojBitaro the Brave (JOI19_ho_t1)C++14
50 / 100
1025 ms74640 KiB
#include <bits/stdc++.h> using namespace std; #define ff first #define ss second #define ll long long #define pb push_back #define pii pair<ll,ll> int main(){ ll ans=0; ll n, m; cin >> n >> m; char c[n+1][m+1]; vector <pii> pos; for(int i=0; i<n; i++){ for(int j=0; j<m; j++){ cin >> c[i][j]; if(c[i][j] == 'J') pos.pb({i,j}); } } for(auto x:pos){ ll a=x.ff, b=x.ss, I=0, O=0; for(int i=a; i<n; i++){ if(c[i][b] == 'I') I++; } for(int i=b; i<m; i++){ if(c[a][i] == 'O') O++; } ans+=I*O; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...