結果

問題 No.40 多項式の割り算
ユーザー jj
提出日時 2017-01-29 02:29:24
言語 Fortran
(gFortran 14.2.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 475 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 33,024 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 22:39:38
合計ジャッジ時間 1,326 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::DA,DB
  integer*8,allocatable::a(:)
  integer::i
  read *,DA
  allocate(a(0:DA))
  read *,a

  do i=DA, 3, -1
     a(i-2) = a(i-2) + a(i)
  end do

  do i=2, 0, -1
     if(a(i).ne.0) exit
  end do
  if(a(2).ne.0) then
     print '(i0)', 2
     print '(i0,1x,i0,1x,i0)', a(0:2)
  else if(a(1).ne.0) then
     print '(i0)', 1
     print '(i0,1x,i0)', a(0:1)
  else
     print '(i0)', 0
     print '(i0)', a(0)
  end if
end program main
0