結果
問題 | No.537 ユーザーID |
ユーザー |
![]() |
提出日時 | 2017-06-30 23:08:06 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
AC
|
実行時間 | 16 ms / 2,000 ms |
コード長 | 1,259 bytes |
コンパイル時間 | 633 ms |
コンパイル使用メモリ | 35,808 KB |
実行使用メモリ | 18,384 KB |
最終ジャッジ日時 | 2024-10-04 21:13:50 |
合計ジャッジ時間 | 1,636 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
program mainimplicit noneinteger*8::i,jinteger*8::Ninteger*8::a,b,aa,bbinteger*8::aaa,bbbinteger*8::total=0,total2=0integer*8,allocatable::list(:),listr(:)read *,Nallocate(list(INT(sqrt(real(N))+1)*2))list=0do i=1,INT(sqrt(real(N)))if(MOD(N,i).ne.0) cyclea = ib = N/iaa = a+roundup(a)*bbb = a*roundup(b)+btotal=total+1list(total)=aatotal=total+1list(total)=bb! print *,aa,bbend doallocate(listr(total))listr = qsortr(list(1:total))total2 = 1do i=2,totalif(listr(i-1).eq.listr(i))cycletotal2=total2+1end doprint '(i0)', total2containsfunction roundup(a) result(aa)integer*8::a,aa,tmpaa = 1tmp = adoaa = aa*10tmp = tmp/10if(tmp.eq.0) exitend doend function rounduprecursive function qsortr(x) result(y)integer*8,intent(in) ::x(:)integer*8,allocatable::y(:)integer*8::pivot,totaltotal = size(x)if (total <=1) theny = xelsepivot = x(total/2)y = [qsortr(pack(x, x .gt. pivot)), &pack(x, x .eq. pivot), &qsortr(pack(x, x .lt. pivot))]endifend function qsortrend program main