結果
| 問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
jj
|
| 提出日時 | 2016-12-27 22:56:42 |
| 言語 | Fortran (gFortran 14.2.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,537 bytes |
| コンパイル時間 | 186 ms |
| コンパイル使用メモリ | 32,896 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-15 04:53:08 |
| 合計ジャッジ時間 | 1,044 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 3 |
コンパイルメッセージ
Main.f90:35:35:
35 | write(*,'(a)',advance='no'),"-"
| 1
Warning: Legacy Extension: Comma before i/o item list at (1)
ソースコード
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
if(input(1:1).eq.'-') then
big_t = big_t + big
small_t = small_t - small
else
big_t = big_t + big
small_t = small_t + small
end if
end do
! print *,big_t,small_t
if(big_t.eq.0) then
carry = small_t/keta
big_t = big_t + carry
if(big_t.eq.0.and.small_t.lt.0) then
write(*,'(a)',advance='no'),"-"
end if
small_t = ABS(MOD(small_t,keta))
else if((small_t.ge.0.and.big_t.ge.0).or. &
(small_t.le.0.and.big_t.le.0)) then
carry = small_t/keta
big_t = big_t + carry
small_t = ABS(MOD(small_t,keta))
else
if(big_t.le.0) then
big_t = -big_t
small_t = -small_t
borrow = small_t/keta + 1
big_t = big_t - borrow
small_t = borrow*keta + small_t
big_t = -big_t
else
borrow = ABS(small_t/keta) + 1
big_t = big_t - borrow
small_t = borrow*keta + small_t
end if
end if
! print *,big_t,small_t
print '(i0,".",i10.10)',big_t,small_t
end program main
jj