結果

問題 No.198 キャンディー・ボックス2
ユーザー jj
提出日時 2016-09-19 05:24:11
言語 Fortran
(gFortran 14.2.0)
結果
WA  
実行時間 -
コード長 307 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 31,744 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-17 09:10:43
合計ジャッジ時間 1,122 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 14 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer*8::B,N,upper,total,i
  integer*8::C(10)
  read *,B,N
  if(N.eq.1) then
     print '(a)',"0"
     return
  end if

  read *,C(1:N)
  upper = (SUM(C(1:N))+B)/N
  total = 0
  do i=1,N
     total = total + ABS(C(i) - upper)
  end do
  print '(i0)', total
end program main
0