結果

問題 No.755 Zero-Sum Rectangle
ユーザー s0j1sans0j1san
提出日時 2018-12-13 22:33:45
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 908 bytes
コンパイル時間 1,070 ms
コンパイル使用メモリ 35,500 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-25 09:40:24
合計ジャッジ時間 6,519 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 169 ms
4,348 KB
testcase_10 AC 146 ms
4,348 KB
testcase_11 WA -
evil_1 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
   implicit none
   integer n,m,i
   integer,allocatable,dimension(:,:)::a
   integer,allocatable,dimension(:)::x,y
   read(*,*)n,m
   allocate(a(m,m))
   allocate(y(n),x(n))
   do i=1,m 
      read(*,*)a(i,1:m)
   enddo
   do i=1,n
      read(*,*)x(i),y(i)
   enddo
   do i=1,n
      call hantei(x(i),y(i))
   enddo
contains
   subroutine hantei(x,y)
      integer,intent(in)::x,y
      integer ::i,j,counter
      counter=0
      do i=1,x-1
         do j=1,y-1
            if(sum(a(i:x,j:y))==0)counter=counter+1
         enddo
         do j=y,m
            if(sum(a(i:x,y:j))==0)counter=counter+1
         enddo
      enddo
      do i=x,m
         do j=1,y-1
            if(sum(a(x:i,j:y))==0)counter=counter+1
         enddo
         do j=y,m
            if(sum(a(x:i,y:j))==0)counter=counter+1
         enddo
      enddo
      write(*,*)counter
   end subroutine hantei
end program main   
0