結果

問題 No.5 数字のブロック
ユーザー concon
提出日時 2018-11-05 19:05:56
言語 Fortran
(gFortran 13.2.0)
結果
AC  
実行時間 245 ms / 5,000 ms
コード長 466 bytes
コンパイル時間 1,429 ms
コンパイル使用メモリ 32,512 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-29 10:04:47
合計ジャッジ時間 4,174 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 95 ms
5,376 KB
testcase_04 AC 20 ms
5,376 KB
testcase_05 AC 153 ms
5,376 KB
testcase_06 AC 65 ms
5,376 KB
testcase_07 AC 45 ms
5,376 KB
testcase_08 AC 78 ms
5,376 KB
testcase_09 AC 12 ms
5,376 KB
testcase_10 AC 151 ms
5,376 KB
testcase_11 AC 38 ms
5,376 KB
testcase_12 AC 103 ms
5,376 KB
testcase_13 AC 133 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 158 ms
5,376 KB
testcase_17 AC 222 ms
5,376 KB
testcase_18 AC 178 ms
5,376 KB
testcase_19 AC 245 ms
5,376 KB
testcase_20 AC 1 ms
5,376 KB
testcase_21 AC 2 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 AC 2 ms
5,376 KB
testcase_28 AC 1 ms
5,376 KB
testcase_29 AC 19 ms
5,376 KB
testcase_30 AC 14 ms
5,376 KB
testcase_31 AC 1 ms
5,376 KB
testcase_32 AC 1 ms
5,376 KB
testcase_33 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

program math_block
implicit none
integer(8) A,i,l,m,n
real(8),allocatable :: x(:)
read(*,*) l
read(*,*) n
allocate (x(n))
read(*,*) (x(m),m=1,n)
call mat(x,n)
A=0
do i=1,n
   A=A+x(i)
   if (A>l) exit
end do
write(*,*) (i-1)
end program

subroutine mat(x,n)
integer(8) n,j,i,t
real(8),dimension(n) ::x
  do i=1,n-1
     do j=i+1,n
        if(x(i) > x(j))then
           t=x(i)
           x(i)=x(j)
           x(j)=t
        end if
     end do
  end do
end subroutine
0