結果

問題 No.351 市松スライドパズル
ユーザー jjjj
提出日時 2016-08-11 23:21:32
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 296 ms / 2,000 ms
コード長 631 bytes
コンパイル時間 1,899 ms
コンパイル使用メモリ 32,184 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2023-10-25 07:48:26
合計ジャッジ時間 6,350 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 264 ms
10,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 288 ms
10,168 KB
testcase_14 AC 290 ms
10,216 KB
testcase_15 AC 294 ms
10,496 KB
testcase_16 AC 296 ms
10,496 KB
testcase_17 AC 290 ms
10,496 KB
testcase_18 AC 290 ms
10,496 KB
testcase_19 AC 295 ms
10,496 KB
testcase_20 AC 295 ms
10,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

  read *,H,W
  read *,N
  allocate(hands(N))
  read *,hands
  r = 0
  c = 0
  do i=N,1,-1
     rc    = hands(i)%RC
     index = hands(i)%index
     select case(rc)
     case ('R')
        if(index.eq.r) c = MOD(c-1+W,W)
     case ('C')
        if(index.eq.c) r = MOD(r-1+H,H)
     end select
  end do
  if(MOD(r+c,2).eq.white) then
     print '(a)',"white"
  else
     print '(a)',"black"
  end if
end program main
0