結果

問題 No.434 占い
ユーザー jj
提出日時 2016-10-14 23:06:29
言語 Fortran
(gFortran 14.2.0)
結果
TLE  
実行時間 -
コード長 594 bytes
コンパイル時間 1,665 ms
コンパイル使用メモリ 32,372 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-11-22 09:43:01
合計ジャッジ時間 24,045 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 20 TLE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer::T,i,j,len
  character*100000::S
  integer::ss(100000)
  read *,T
  do i=1,T
     read *,S
     len = LEN_TRIM(S)
     do j=1,len
        ss(j) = ICHAR(S(j:j))-ICHAR('0')
     end do
     call uranai(ss, len)
  end do
contains
  subroutine uranai(ss, len)
    integer::ss(100000)
    integer::len,i,j,tmp
    do i=1,len-1
       do j=1,len-i
          ss(j) = ss(j) + ss(j+1)
          if(ss(j).ge.10) then
             ss(j) = ss(j)/10 + ss(j)-10
          end if
       end do
    end do
    print '(i0)', ss(1)
  end subroutine uranai
end program main
0