結果

問題 No.415 ぴょん
ユーザー jj
提出日時 2016-08-26 22:30:08
言語 Fortran
(gFortran 14.2.0)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 1,529 ms
コンパイル使用メモリ 31,616 KB
実行使用メモリ 788,480 KB
最終ジャッジ日時 2024-11-08 09:29:49
合計ジャッジ時間 5,128 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 3 MLE * 2 -- * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

program main
  implicit none
  integer::N,D,i,curr,next
  integer,allocatable::ashiba(:)
  read *,N,D
  allocate(ashiba(N))
  ashiba = 1
  curr = 1
  do i=1,N
     ashiba(curr) = 0
     next = MOD(curr+D,N)+1
     if(ashiba(next).eq.0) exit
     curr = next
  end do
  i = MIN(N,i)
  print '(i0)',i
end program main
0