답안 #174131

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
174131 2020-01-06T09:44:51 Z AlexLuchianov Bitaro the Brave (JOI19_ho_t1) C++14
20 / 100
26 ms 2716 KB
#include <iostream>

using namespace std;

using ll = long long;
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) < (b)) ? (b) : (a))

int const nmax = 500;
char v[1 + nmax][1 + nmax];
int ingots[1 + nmax][1 + nmax], orbs[1 + nmax][1 + nmax];

int main()
{
  int n, m;
  cin >> n >> m;
  for(int i = 1;i <= n; i++)
    for(int j = 1;j <= m; j++) {
      cin >> v[i][j];
      if(v[i][j] == 'O')
        orbs[i][j]++;
      else if(v[i][j] == 'I')
        ingots[i][j]++;
    }

  for(int i = n; 1 <= i; i--)
    for(int j = m; 1 <= j; j--) {
      orbs[i][j] += orbs[i][j + 1];
      ingots[i][j] += ingots[i + 1][j];
    }

  ll result = 0;
  for(int i = 1;i <= n; i++)
    for(int j = 1;j <= m; j++)
      if(v[i][j] == 'J') {
        result += orbs[i][j] * ingots[i][j];
      }
  cout << result << '\n';
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 508 KB Output is correct
5 Correct 4 ms 760 KB Output is correct
6 Correct 3 ms 760 KB Output is correct
7 Correct 4 ms 760 KB Output is correct
8 Correct 3 ms 760 KB Output is correct
9 Correct 3 ms 760 KB Output is correct
10 Correct 3 ms 760 KB Output is correct
11 Correct 3 ms 760 KB Output is correct
12 Correct 3 ms 760 KB Output is correct
13 Correct 3 ms 760 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 508 KB Output is correct
5 Correct 4 ms 760 KB Output is correct
6 Correct 3 ms 760 KB Output is correct
7 Correct 4 ms 760 KB Output is correct
8 Correct 3 ms 760 KB Output is correct
9 Correct 3 ms 760 KB Output is correct
10 Correct 3 ms 760 KB Output is correct
11 Correct 3 ms 760 KB Output is correct
12 Correct 3 ms 760 KB Output is correct
13 Correct 3 ms 760 KB Output is correct
14 Incorrect 26 ms 2716 KB Output isn't correct
15 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 508 KB Output is correct
5 Correct 4 ms 760 KB Output is correct
6 Correct 3 ms 760 KB Output is correct
7 Correct 4 ms 760 KB Output is correct
8 Correct 3 ms 760 KB Output is correct
9 Correct 3 ms 760 KB Output is correct
10 Correct 3 ms 760 KB Output is correct
11 Correct 3 ms 760 KB Output is correct
12 Correct 3 ms 760 KB Output is correct
13 Correct 3 ms 760 KB Output is correct
14 Incorrect 26 ms 2716 KB Output isn't correct
15 Halted 0 ms 0 KB -