結果
| 問題 |
No.156 キャンディー・ボックス
|
| コンテスト | |
| ユーザー |
con
|
| 提出日時 | 2019-06-17 19:53:48 |
| 言語 | Fortran (gFortran 14.2.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 363 bytes |
| コンパイル時間 | 1,563 ms |
| コンパイル使用メモリ | 32,768 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-05 16:27:28 |
| 合計ジャッジ時間 | 2,489 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 |
ソースコード
implicit none
integer(8) i,l,n,m,e,f
integer(8),allocatable :: c(:)
integer(8),allocatable :: d(:)
read(*,*) n,m
allocate (c(n))
allocate (d(1:n))
c=0
d=0
e=0
f=0
read(*,*) (C(l),l=1,n)
do i=1,n
d(i)=maxval(c)
c(maxloc(c))=0
end do
do while (m>e)
e=e+d(n)
n=n-1
f=f+1
end do
if (e==m) then
write(*,*) f
else
write(*,*) f-1
end if
end
con