結果

問題 No.537 ユーザーID
ユーザー jjjj
提出日時 2017-06-30 23:08:06
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 20 ms / 2,000 ms
コード長 1,259 bytes
コンパイル時間 1,151 ms
コンパイル使用メモリ 35,576 KB
実行使用メモリ 18,336 KB
最終ジャッジ日時 2024-04-15 06:59:44
合計ジャッジ時間 2,426 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 12 ms
13,788 KB
testcase_19 AC 17 ms
17,408 KB
testcase_20 AC 14 ms
15,292 KB
testcase_21 AC 10 ms
10,604 KB
testcase_22 AC 15 ms
16,612 KB
testcase_23 AC 9 ms
10,520 KB
testcase_24 AC 4 ms
5,376 KB
testcase_25 AC 16 ms
16,640 KB
testcase_26 AC 16 ms
17,920 KB
testcase_27 AC 13 ms
13,952 KB
testcase_28 AC 10 ms
8,232 KB
testcase_29 AC 20 ms
18,020 KB
testcase_30 AC 19 ms
15,272 KB
testcase_31 AC 8 ms
7,552 KB
testcase_32 AC 8 ms
7,676 KB
testcase_33 AC 18 ms
18,336 KB
testcase_34 AC 12 ms
12,792 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::i,j
  integer*8::N
  integer*8::a,b,aa,bb
  integer*8::aaa,bbb
  integer*8::total=0,total2=0
  integer*8,allocatable::list(:),listr(:)

  read *,N
  allocate(list(INT(sqrt(real(N))+1)*2))
  list=0
  do i=1,INT(sqrt(real(N)))
     if(MOD(N,i).ne.0) cycle

     a = i
     b = N/i
     aa = a+roundup(a)*b
     bb = a*roundup(b)+b
     total=total+1
     list(total)=aa
     total=total+1
     list(total)=bb
     !     print *,aa,bb
  end do
  allocate(listr(total))
  listr = qsortr(list(1:total))

  total2 = 1
  do i=2,total
     if(listr(i-1).eq.listr(i))cycle
     total2=total2+1
  end do

  print '(i0)', total2
contains
  function roundup(a) result(aa)
    integer*8::a,aa,tmp
    aa = 1
    tmp = a
    do
       aa = aa*10
       tmp = tmp/10
       if(tmp.eq.0) exit
    end do
  end function roundup
  recursive function qsortr(x) result(y)
    integer*8,intent(in) ::x(:)
    integer*8,allocatable::y(:)
    integer*8::pivot,total
    total = size(x)
    if (total <=1) then
       y = x
    else
       pivot = x(total/2)
       y = [qsortr(pack(x, x .gt. pivot)), &
            pack(x, x .eq. pivot),        &
            qsortr(pack(x, x .lt. pivot))]
    endif
  end function qsortr

end program main
0