結果

問題 No.3023 素数判定するだけ
ユーザー jjjj
提出日時 2017-04-01 00:05:06
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 919 bytes
コンパイル時間 1,153 ms
コンパイル使用メモリ 32,512 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-15 06:32:06
合計ジャッジ時間 3,931 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,944 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,940 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,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 1 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 1 ms
6,940 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 1 ms
6,940 KB
testcase_22 AC 1 ms
6,944 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:11:22:

   11 |   write(cf(d:d),'(a)'), ACHAR(f)
      |                      1
Warning: Legacy Extension: Comma before i/o item list at (1)

ソースコード

diff #

program main
  integer::N
  integer,parameter::a=LEN_TRIM("")
  integer,parameter::b=LEN_TRIM("a")
  integer,parameter::c=LEN_TRIM("aa")
  integer,parameter::d=LEN_TRIM("aaa")
  integer,parameter::e=LEN_TRIM("aaaa")
  integer,parameter::f=LEN_TRIM("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
  character(len=e)::cf='(i )'
  integer,allocatable::isPr(:)
  write(cf(d:d),'(a)'), ACHAR(f)
  read cf,N
  allocate(isPr(N))
  call get_pr(isPr,N)
  if(isPr(N).eq.a) then
     print '(a)',"NO"
  else
     print '(a)',"YES"
  end if
contains
  subroutine get_pr(isPr, N)
    implicit none
    integer::i,j,N
    integer,parameter::pr=b,nonpr=a
    integer,allocatable::isPr(:)

    isPr=pr
    isPr(b)=nonpr
    do i=c, FLOOR(SQRT(REAL(N)))
       if(isPr(i).eq.pr) then
          do j=ISHFT(i,b), N, i
             isPr(j) = nonpr
          end do
       end if
    end do
  end subroutine get_pr
end program main
0