結果

問題 No.240 ナイト散歩
ユーザー jjjj
提出日時 2016-10-01 21:14:06
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 733 bytes
コンパイル時間 2,239 ms
コンパイル使用メモリ 32,640 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 09:27:11
合計ジャッジ時間 2,817 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 1 ms
6,940 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 1 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,944 KB
testcase_18 AC 1 ms
6,940 KB
testcase_19 AC 1 ms
6,944 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 1 ms
6,940 KB
testcase_23 AC 1 ms
6,944 KB
testcase_24 AC 1 ms
6,940 KB
testcase_25 AC 1 ms
6,940 KB
testcase_26 AC 1 ms
6,940 KB
testcase_27 AC 1 ms
6,944 KB
testcase_28 AC 1 ms
6,940 KB
testcase_29 AC 1 ms
6,940 KB
testcase_30 WA -
testcase_31 AC 1 ms
6,940 KB
testcase_32 AC 1 ms
6,944 KB
testcase_33 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:18:25:

   16 |      do i=-8,8
      |              2           
   17 |         do j=-8,8
   18 |            dp2(i,j) = dp(i-1,j-2).or. &
      |                         1
Warning: Array reference at (1) out of bounds (-9 < -8) in loop beginning at (2)
Main.f90:18:29:

   17 |         do j=-8,8
      |                 2            
   18 |            dp2(i,j) = dp(i-1,j-2).or. &
      |                             1
Warning: Array reference at (1) out of bounds (-10 < -8) in loop beginning at (2)
Main.f90:19:19:

   16 |      do i=-8,8
      |              2     
......
   19 |                 dp(i+1,j+2).or. &
      |                   1
Warning: Array reference at (1) out of bounds (9 > 8) in loop beginning at (2)
Main.f90:19:23:

   17 |         do j=-8,8
      |                 2      
   18 |            dp2(i,j) = dp(i-1,j-2).or. &
   19 |                 dp(i+1,j+2).or. &
      |                       1
Warning: Array reference at (1) out of bounds (10 > 8) in loop beginning at (2)
Main.f90:20:19:

   16 |      do i=-8,8
      |              2     
......
   20 |                 dp(i-1,j+2).or. &
      |                   1
Warning: Array reference at (1) out of bounds (-9 < -8) in loop beginning at (2)
Main.f90:20:23:

   17 |         do j=-8,8
      |                 2      
......
   20 |                 dp(i-1,j+2).or. &
      |                       1
Warning: Array reference at (1) out of bounds (10 > 8) in loop beginning at (2)
Main.f90:21:19:

   16 |      do i=-8,8
      |              2     
......
   21 |                 dp(i+1,j-2).or. &
      |                   1
Warning: Array reference at (1) out of bounds (9 > 8) in loop beginning at (2)
Main.f90:21:23:

   17 |         do j=-8,8
      |                 2      
......
   21 |                 dp(i+1,j-2).or. &
      |                       1
Warning: Array reference at (1) out of bounds (-10 < -8) in loop beginning at (2)
Main.f90:22:19:

   16 |      do i=-8,8
      |              2 

ソースコード

diff #

program main
  implicit none
  logical::dp(-8:8,-8:8),dp2(-8:8,-8:8)
  integer::i,j,k
  integer*8::X,Y
  data dp/289*.false./
  read *,X,Y
  if(abs(X).gt.6.or.abs(Y).gt.6) then
     print '(a)',"NO"
     return
  end if

  dp(0,0)=.true.
  do k=1,3
     dp2 = dp
     do i=-8,8
        do j=-8,8
           dp2(i,j) = dp(i-1,j-2).or. &
                dp(i+1,j+2).or. &
                dp(i-1,j+2).or. &
                dp(i+1,j-2).or. &
                dp(i-2,j-1).or. &
                dp(i+2,j+1).or. &
                dp(i-2,j+1).or. &
                dp(i+2,j-1)
        end do
     end do
     dp = dp.or.dp2
  end do
  if(dp(X,Y).eqv..true.) then
     print '(a)',"YES"
  else
     print '(a)',"NO"
  end if

end program main
0