# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1003010 | 2024-06-20T00:48:46 Z | tamir1 | Bitaro the Brave (JOI19_ho_t1) | C++17 | 컴파일 오류 |
0 ms | 0 KB |
#include <bits/stdc++.h> 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
joi2019_ho_t1.cpp:7:11: error: extended character is not valid in an identifier 7 | int n, m; | ^ joi2019_ho_t1.cpp:8:15: error: extended character is not valid in an identifier 8 | void input(){ | ^ joi2019_ho_t1.cpp:8:18: error: extended character is not valid in an identifier 8 | void input(){ | ^ joi2019_ho_t1.cpp:9:18: error: extended character is not valid in an identifier 9 | cin >> n >> m; | ^ joi2019_ho_t1.cpp:9:21: error: extended character is not valid in an identifier 9 | cin >> n >> m; | ^ joi2019_ho_t1.cpp:10:32: error: extended character is not valid in an identifier 10 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:10:35: error: extended character is not valid in an identifier 10 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:10:38: error: extended character is not valid in an identifier 10 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:10:41: error: extended character is not valid in an identifier 10 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:10:56: error: extended character is not valid in an identifier 10 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:10:62: error: extended character is not valid in an identifier 10 | for (int i = 0; i < n; ++i){ cin >> s[i]; } } | ^ joi2019_ho_t1.cpp:11:20: error: extended character is not valid in an identifier 11 | void preprocess(){ | ^ joi2019_ho_t1.cpp:11:23: error: extended character is not valid in an identifier 11 | void preprocess(){ | ^ joi2019_ho_t1.cpp:12:32: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:35: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:38: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:41: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:56: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:59: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:62: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:12:65: error: extended character is not valid in an identifier 12 | for (int i = 0; i < n; ++i){ O[i][m] = 0; | ^ joi2019_ho_t1.cpp:13:52: error: extended character is not valid in an identifier 13 | 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:13:55: error: extended character is not valid in an identifier 13 | 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:13:58: error: extended character is not valid in an identifier 13 | 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:13:61: error: extended character is not valid in an identifier 13 | 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:13:64: error: extended character is not valid in an identifier 13 | 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:13:67: error: extended character is not valid in an identifier 13 | 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:13:92: error: extended character is not valid in an identifier 13 | 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:13:95: error: extended character is not valid in an identifier 13 | 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:13:98: error: extended character is not valid in an identifier 13 | 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:13:101: error: extended character is not valid in an identifier 13 | 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:13:104: error: extended character is not valid in an identifier 13 | 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:13:107: error: extended character is not valid in an identifier 13 | 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:13:130: error: extended character is not valid in an identifier 13 | 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:13:133: error: extended character is not valid in an identifier 13 | 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:13:136: error: extended character is not valid in an identifier 13 | 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:13:139: error: extended character is not valid in an identifier 13 | 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:13:142: error: extended character is not valid in an identifier 13 | 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:13:145: error: extended character is not valid in an identifier 13 | 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();} |