# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
580853 | Metal_Sonic | Bitaro the Brave (JOI19_ho_t1) | C++17 | 8 ms | 9172 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define sz(x) (int)(x).size()
#define all(x) x.begin() , x.end()
void setIO(string name = "") {
ios_base::sync_with_stdio(false); cin.tie(nullptr);
if(sz(name)){
freopen((name+".in").c_str(), "r", stdin);
freopen((name+".out").c_str(), "w", stdout);
}
}
const int N = 3005;
int I[N][N] , O[N][N] , J[N][N];
void run_test_case(){
int n , m;cin>>n>>m;
for(int i = 0; i < n; i++){
string s;cin>>s;
for(int j = 0; j < m; j++){
if(s[j] == 'I')I[i][j]++;
else if(s[j] == 'O')O[i][j]++;
else J[i][j]++;
if(j)O[i][j]+=O[i][j-1];
if(i)I[i][j]+=I[i-1][j];
}
}
int ans = 0;
for(int i = 0; i < n; i++){
for(int j = 0; j < m; j++){
if(J[i][j])ans+=(O[i][m-1]-O[i][j])*(I[n-1][j]-I[i][j]);
}
}
cout<<ans;
}
int main() {
setIO();
int T = 1;
while(T--){
run_test_case();
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |