Submission #128324

#TimeUsernameProblemLanguageResultExecution timeMemory
128324miguelBitaro the Brave (JOI19_ho_t1)C++14
20 / 100
32 ms21676 KiB
#include<bits/stdc++.h> using namespace std; #define rc(x) return cout<<x<<endl,0 #define pb push_back #define dbg(x) cout << #x << '=' << x << '\n'; #define ll long long #define sz size() #define x first #define y second #define pi pair <int, int> #define pii pair <int, pi> #define vi vector <int> const ll mod = 1e9 + 7; int n, m, t[7][3003][3003], ans; int get(char c){ if(c=='J') return 1; else if(c=='I') return 2; else if(c=='O') return 3; } int32_t main(){ ios_base :: sync_with_stdio(0); cin.tie(); cout.tie(); cin>>n>>m; for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ char c; cin>>c; t[0][i][j]=get(c); for(int idx=1; idx<=3; idx++) t[idx][i][j]=t[idx][i][j-1]; for(int idx=4; idx<=6; idx++) t[idx][i][j]=t[idx][i-1][j]; t[get(c)][i][j]++; t[get(c)+3][i][j]++; } } for(int i=1; i<=n; i++){ for(int j=1; j<=m; j++){ if(t[0][i][j]==1) ans+=(t[3][i][m]-t[3][i][j])*(t[5][n][j]-t[5][i][j]); } } cout<<ans; }

Compilation message (stderr)

joi2019_ho_t1.cpp: In function 'int get(char)':
joi2019_ho_t1.cpp:20:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...