結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー jjjj
提出日時 2016-09-11 16:00:31
言語 Fortran
(gFortran 13.2.0)
結果
WA  
実行時間 -
コード長 999 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 31,744 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-28 12:04:19
合計ジャッジ時間 1,229 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 WA -
testcase_04 AC 2 ms
6,940 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 1 ms
6,940 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 1 ms
6,940 KB
testcase_26 AC 1 ms
6,940 KB
testcase_27 WA -
testcase_28 AC 1 ms
6,944 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::N,i,dot,len,borrow,carry
  integer*8::big,small,big_t,small_t
  integer*8,parameter::keta=10000000000_8
  character*22::input
  data big_t,small_t/2*0/
  read *,N
  do i=1,N
     read *,input
     len = LEN_TRIM(input)
     dot = SCAN(input,'.')
     if(dot.ne.0) then
        read (input(1:dot-1),*) big
        read (input(dot+1:len),*) small
        small = 10**(10-len+dot)*small
     else
        read (input(1:len),*) big
        small = 0
     end if
     big_t = big_t + big
     if(input(1:1).eq.'-') then
        small_t = small_t - small
     else
        small_t = small_t + small
     end if
!     print '(i0," ",i0," ",i0," ",i0)',big,small,big_t,small_t
  end do

  if(small_t.ge.0) then
     carry = small_t/keta
     big_t = big_t + carry
     small_t = MOD(small_t,keta)
  else
     borrow = small_t/keta+1
     big_t = big_t - borrow
     small_t = borrow*keta - small_t
  end if
  print '(i0,".",i10.10)',big_t,small_t

end program main
0