結果

問題 No.360 増加門松列
ユーザー LeonardoneLeonardone
提出日時 2016-04-17 23:09:43
言語 Fortran
(gFortran 13.2.0)
結果
RE  
実行時間 -
コード長 1,409 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 32,384 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 02:25:51
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:22:32:

   21 |               DO j = 0, 6
      |                         2       
   22 |                   k = MOD(i / x(j), 10) + 1
      |                                1
Warning: Array reference at (1) out of bounds (0 < 1) in loop beginning at (2)

ソースコード

diff #

! Try yukicoder
! author: Leonardone @ NEETSDKASU
 
      PROGRAM yukicoder
          INTEGER :: a(7), i, j, k, x(7), d(7), f(7), r, b(7)
          
          READ (*,*) a
          
          DO j = 0, 6
              x(j + 1) = 10 ** j
          END DO
          
          r = 1
          DO i = 123456, 6543210
              IF (r > 0) THEN
                  DO j = 1, 7
                      f(j) = 0
                  END DO
                  r = 0
              END IF
              DO j = 0, 6
                  k = MOD(i / x(j), 10) + 1
                  IF (k > 7) exit
                  IF (f(k) > 0) exit
                  f(k) = 1
                  b(j + 1) = a(k)
                  r = r + 1
              END DO
              IF (r < 7) cycle
              IF (b(1) >= b(3)) cycle
              IF (b(2) >= b(4)) cycle
              IF (b(3) >= b(5)) cycle
              IF (b(4) >= b(6)) cycle
              IF (b(5) >= b(7)) cycle
              IF (b(1) <= b(2) .and. b(2) <= b(3)) cycle
              IF (b(2) <= b(3) .and. b(3) <= b(4)) cycle
              IF (b(3) <= b(4) .and. b(4) <= b(5)) cycle
              IF (b(4) <= b(5) .and. b(5) <= b(6)) cycle
              IF (b(5) <= b(6) .and. b(6) <= b(7)) cycle
              
              PRINT '(A)', 'YES'
              STOP
              
          END DO
          
          PRINT '(A)', 'NO'
          
      END PROGRAM yukicoder
0