| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1289202 | Joon_Yorigami | Bitaro the Brave (JOI19_ho_t1) | Pypy 3 | 471 ms | 339968 KiB |
t=1
while t:
t-=1
n,m=map(int,input().split())
grid=[]
for _ in" "*n:
grid.append([*input().strip()])
#J O
#I
horse=[]
bird=[]
for i in range(n):
arr=[0]
for j in range(m):
arr.append((grid[i][j]=="O")+arr[-1])
horse.append(arr)
for j in range(m):
arr=[0]
for i in range(n):
arr.append((grid[i][j]=="I")+arr[-1])
bird.append(arr)
total=0
for i in range(n):
for j in range(m):
if grid[i][j]!="J":
continue
x=horse[i][-1]-horse[i][j]
y=bird[j][-1]-bird[j][i]
total+=x*y
print(total)
컴파일 시 표준 출력 (stdout) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
