Submission #997901

#TimeUsernameProblemLanguageResultExecution timeMemory
997901elojBitaro the Brave (JOI19_ho_t1)C++14
50 / 100
1045 ms48840 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<int,int> int main(){ ll ans=0; int 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){ int 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...