結果

問題 No.406 鴨等間隔の法則
ユーザー jjjj
提出日時 2016-08-05 22:45:42
言語 Fortran
(gFortran 13.2.0)
結果
MLE  
(最新)
AC  
(最初)
実行時間 -
コード長 599 bytes
コンパイル時間 2,430 ms
コンパイル使用メモリ 27,472 KB
実行使用メモリ 272,100 KB
最終ジャッジ日時 2023-08-06 23:11:10
合計ジャッジ時間 3,624 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
58,620 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 78 ms
53,188 KB
testcase_05 AC 46 ms
35,864 KB
testcase_06 AC 36 ms
25,948 KB
testcase_07 AC 37 ms
27,048 KB
testcase_08 AC 79 ms
51,860 KB
testcase_09 AC 58 ms
31,428 KB
testcase_10 AC 64 ms
50,012 KB
testcase_11 AC 114 ms
88,140 KB
testcase_12 AC 94 ms
76,544 KB
testcase_13 AC 54 ms
39,748 KB
testcase_14 MLE -
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 33 ms
28,572 KB
testcase_17 AC 17 ms
15,880 KB
testcase_18 AC 35 ms
31,900 KB
testcase_19 AC 38 ms
35,976 KB
testcase_20 AC 55 ms
50,300 KB
testcase_21 AC 54 ms
48,592 KB
testcase_22 AC 99 ms
90,384 KB
testcase_23 AC 39 ms
23,428 KB
testcase_24 AC 22 ms
4,380 KB
testcase_25 AC 109 ms
79,036 KB
testcase_26 AC 30 ms
4,376 KB
testcase_27 AC 28 ms
4,380 KB
testcase_28 AC 30 ms
4,892 KB
testcase_29 AC 59 ms
30,008 KB
testcase_30 AC 55 ms
26,888 KB
testcase_31 AC 60 ms
33,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

  integer::N,i,start=10**8,kankaku
  integer,allocatable::x(:)
  integer::zahyou(0:10**8)
  data zahyou/100000001*0/
  read *, N
  allocate(x(N))
  read *, x

  do i=1,N
     if(zahyou(x(i)).eq.1) then
        print '(a)', "NO"
        return
     end if
     zahyou(x(i)) = 1
     start = MIN(start, x(i))
  end do

  do i=start+1,10**8
     if(zahyou(i).eq.1) then
        kankaku = i - start
        exit
     end if
  end do

  do i=start, start+(N-1)*kankaku, kankaku
     if(zahyou(i).ne.1) then
        print '(a)', "NO"
        return
     end if
  end do

  print '(a)', "YES"
end program

0