# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1003009 | tamir1 | Bitaro the Brave (JOI19_ho_t1) | C++17 | Compilation error | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <cstring>
using namespace std;
const int N = 3030;
int O[N][N];
int I[N][N];
string s[N];
int n, m;
void input(){
cin >> n >> m;
for (int i = 0; i < n; ++i){ cin >> s[i]; } }
void preprocess(){
for (int i = 0; i < n; ++i){ O[i][m] = 0;
for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();}
Compilation message (stderr)
joi2019_ho_t1.cpp:8:11: error: extended character is not valid in an identifier 8 | int n, m; | ^ joi2019_ho_t1.cpp:9:15: error: extended character is not valid in an identifier 9 | void input(){ | ^ joi2019_ho_t1.cpp:9:18: error: extended character is not valid in an identifier 9 | void input(){ | ^ joi2019_ho_t1.cpp:10:18: error: extended character is not valid in an identifier 10 | cin >> n >> m; | ^ joi2019_ho_t1.cpp:10:21: error: extended character is not valid in an identifier 10 | cin >> n >> m; | ^ joi2019_ho_t1.cpp:11:32: error: extended character is not valid in an identifier 11 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:11:35: error: extended character is not valid in an identifier 11 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:11:38: error: extended character is not valid in an identifier 11 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:11:41: error: extended character is not valid in an identifier 11 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:11:56: error: extended character is not valid in an identifier 11 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:11:62: error: extended character is not valid in an identifier 11 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:12:20: error: extended character is not valid in an identifier 12 | void preprocess(){ | ^ joi2019_ho_t1.cpp:12:23: error: extended character is not valid in an identifier 12 | void preprocess(){ | ^ joi2019_ho_t1.cpp:13:32: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:35: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:38: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:41: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:56: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:59: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:62: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:65: error: extended character is not valid in an identifier 13 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:14:52: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:55: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:58: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:61: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:64: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:67: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:92: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:95: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:98: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:101: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:104: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:107: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:130: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:133: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:136: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:139: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:142: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} | ^ joi2019_ho_t1.cpp:14:145: error: extended character is not valid in an identifier 14 | for (int j = m - 1; j >= 0; --j){ O[i][j] = O[i][j + 1]; if (s[i][j] == 'O'){ ++O[i][j]; } } } for (int j = 0; j < m; ++j){ I[n][j] = 0; for (int i = n - 1; i >= 0; --i){ I[i][j] = I[i + 1][j]; if (s[i][j] == 'I'){ ++I[i][j]; } } }} int solve(){ long long ans = 0; for (int i = 0; i < n; ++i){ for (int j = 0; j < m; ++j){ if (s[i][j] == 'J'){ ans += O[i][j] * I[i][j]; } } } return ans;} int main(){ input(); preprocess(); cout << solve();} |