답안 #795994

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
795994 2023-07-28T03:30:55 Z vjudge1 Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
335 ms 159104 KB
// Problem: B - Bitaro the Brave
// Contest: Virtual Judge - THT - Day 14
// URL: https://vjudge.net/contest/571691#problem/B
// Memory Limit: 268 MB
// Time Limit: 1000 ms

#include <bits/stdc++.h>
#define ll long long
#define sp << " "
#define faster ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using namespace std;
ll n, m, k, t, s;
char c[3005][3005];
ll a[3005][3005], b[3005][3005];
int main(){
    faster;
    cin >> n >> m;
    for(ll i = 1; i <= n; i++){
    	for(ll j = 1; j <= m; j++) cin >> c[i][j];
    }
    for(ll i = 1; i <= n; i++){
    	for(ll j = m; j >= 1; j--){
    		a[i][j]=a[i][j+1];
    		if(c[i][j]=='O') a[i][j]++;
    	}
    }
    for(ll j = 1; j <= m; j++){
    	for(ll i = n; i >= 1; i--){
    		b[i][j]=b[i+1][j];
    		if(c[i][j]=='I') b[i][j]++;
    	}
    }
    for(ll i = 1; i <= n; i++){
    	for(ll j = 1; j <= m; j++){
			if(c[i][j]=='J')s+=(a[i][j]*b[i][j]);
    	}
    }
    cout << s;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 1492 KB Output is correct
6 Correct 1 ms 1492 KB Output is correct
7 Correct 1 ms 1364 KB Output is correct
8 Correct 1 ms 1492 KB Output is correct
9 Correct 1 ms 1492 KB Output is correct
10 Correct 1 ms 1364 KB Output is correct
11 Correct 1 ms 1492 KB Output is correct
12 Correct 1 ms 1492 KB Output is correct
13 Correct 1 ms 1364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 1492 KB Output is correct
6 Correct 1 ms 1492 KB Output is correct
7 Correct 1 ms 1364 KB Output is correct
8 Correct 1 ms 1492 KB Output is correct
9 Correct 1 ms 1492 KB Output is correct
10 Correct 1 ms 1364 KB Output is correct
11 Correct 1 ms 1492 KB Output is correct
12 Correct 1 ms 1492 KB Output is correct
13 Correct 1 ms 1364 KB Output is correct
14 Correct 8 ms 8788 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 5 ms 5204 KB Output is correct
17 Correct 0 ms 468 KB Output is correct
18 Correct 9 ms 9684 KB Output is correct
19 Correct 7 ms 9556 KB Output is correct
20 Correct 8 ms 9532 KB Output is correct
21 Correct 9 ms 9708 KB Output is correct
22 Correct 7 ms 9556 KB Output is correct
23 Correct 8 ms 9556 KB Output is correct
24 Correct 9 ms 9684 KB Output is correct
25 Correct 8 ms 9580 KB Output is correct
26 Correct 7 ms 9556 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 1492 KB Output is correct
6 Correct 1 ms 1492 KB Output is correct
7 Correct 1 ms 1364 KB Output is correct
8 Correct 1 ms 1492 KB Output is correct
9 Correct 1 ms 1492 KB Output is correct
10 Correct 1 ms 1364 KB Output is correct
11 Correct 1 ms 1492 KB Output is correct
12 Correct 1 ms 1492 KB Output is correct
13 Correct 1 ms 1364 KB Output is correct
14 Correct 8 ms 8788 KB Output is correct
15 Correct 2 ms 4948 KB Output is correct
16 Correct 5 ms 5204 KB Output is correct
17 Correct 0 ms 468 KB Output is correct
18 Correct 9 ms 9684 KB Output is correct
19 Correct 7 ms 9556 KB Output is correct
20 Correct 8 ms 9532 KB Output is correct
21 Correct 9 ms 9708 KB Output is correct
22 Correct 7 ms 9556 KB Output is correct
23 Correct 8 ms 9556 KB Output is correct
24 Correct 9 ms 9684 KB Output is correct
25 Correct 8 ms 9580 KB Output is correct
26 Correct 7 ms 9556 KB Output is correct
27 Correct 305 ms 158552 KB Output is correct
28 Correct 12 ms 26324 KB Output is correct
29 Correct 16 ms 13868 KB Output is correct
30 Correct 1 ms 724 KB Output is correct
31 Correct 231 ms 131400 KB Output is correct
32 Correct 292 ms 158924 KB Output is correct
33 Correct 296 ms 158600 KB Output is correct
34 Correct 267 ms 152452 KB Output is correct
35 Correct 290 ms 159104 KB Output is correct
36 Correct 293 ms 158416 KB Output is correct
37 Correct 335 ms 159068 KB Output is correct
38 Correct 206 ms 130752 KB Output is correct
39 Correct 203 ms 130840 KB Output is correct