結果

問題 No.351 市松スライドパズル
ユーザー jjjj
提出日時 2016-08-11 23:06:32
言語 Fortran
(gFortran 13.2.0)
結果
TLE  
実行時間 -
コード長 1,099 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 34,652 KB
実行使用メモリ 406,656 KB
最終ジャッジ日時 2024-04-25 01:40:40
合計ジャッジ時間 6,273 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 278 ms
16,000 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 TLE -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:48:38:

   48 |           write(*,'(i0)',advance='no'),board(jj,ii)
      |                                      1
Warning: Legacy Extension: Comma before i/o item list at (1)

ソースコード

diff #

program main
  implicit none
  type hand
     character::RC
     integer::index
  end type hand
  integer::H,W,N,i,j,index
  character::rc
  type(hand),allocatable::hands(:)
  integer,allocatable::board(:,:)
  integer,parameter::white=0,black=1

  read *,H,W
  read *,N
  allocate(hands(N))
  allocate(board(W,H))
  read *,hands
  do i=1,H
     do j=1,W
        board(j,i) = MOD((i+j),2) !ichimatsu
     end do
  end do
  do i=1,N
     rc    = hands(i)%RC
     index = hands(i)%index+1
     select case(rc)
     case ('R')
        board(1:W,index) = [board(W,index),board(1:W-1,index)]
     case ('C')
        board(index,1:H) = [board(index,H),board(index,1:H-1)]
     end select
  end do

  if(board(1,1).eq.white) then
     print '(a)',"white"
  else
     print '(a)',"black"
  end if
contains
  subroutine slide_r()
    integer::ii
  end subroutine slide_r

  subroutine state()
    integer::ii,jj
    do ii=1,H
       do jj=1,W-1
          write(*,'(i0)',advance='no'),board(jj,ii)
       end do
       print '(i0)',board(W,ii)
    end do
    print *,""
  end subroutine state
end program main
0