結果

問題 No.415 ぴょん
コンテスト
ユーザー jj
提出日時 2016-08-26 22:42:47
言語 Fortran
(gFortran 15.2.0)
コンパイル:
gfortran _filename_ -O2 -o ./a.out
実行:
./a.out
結果
WA  
実行時間 -
コード長 365 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 215 ms
コンパイル使用メモリ 38,400 KB
実行使用メモリ 783,852 KB
最終ジャッジ日時 2026-05-08 15:41:42
合計ジャッジ時間 6,059 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 1 WA * 2 RE * 3 TLE * 2 MLE * 1 -- * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

program main
  implicit none
  integer*8::N,D,i,curr,next,total
  integer,allocatable::ashiba(:)
  read *,N,D
  allocate(ashiba(0:D))
  ashiba = 1
  curr = 0
  total = 0

  do i=1,D
     ashiba(curr) = 0
     total = (N-curr)/D + total
     next = MOD(curr+(N/D+1)*D,N)
     if(ashiba(next).eq.0) exit
     curr = next
  end do
  print '(i0)',total
end program main
0