結果

問題 No.1073 無限すごろく
ユーザー trineutrontrineutron
提出日時 2020-06-05 22:27:04
言語 Fortran
(gFortran 14.2.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 210 bytes
コンパイル時間 547 ms
コンパイル使用メモリ 33,152 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-12-17 16:10:15
合計ジャッジ時間 1,226 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.f90:3:4:

    2 | do i=1,6
      |        2
    3 | t(i,i+1)=1
      |    1
Warning: Array reference at (1) out of bounds (7 > 6) in loop beginning at (2)
Main.f90:3:10:

    3 | t(i,i+1)=1
      |          ^
Warning: iteration 5 invokes undefined behavior [-Waggressive-loop-optimizations]
Main.f90:2:5:

    2 | do i=1,6
      |     ^
note: within this loop

ソースコード

diff #

integer(16)::n,t(6,6)=0,a(6,6)=0,m=1000000007,r=166666668
do i=1,6
t(i,i+1)=1
t(i,1)=r
a(i,i)=1
enddo
read*,n
do while(n>0)
if(mod(n,2)==1)a=mod(matmul(a,t),m)
t=mod(matmul(t,t),m)
n=n/2
enddo
print*,a(1,1)
end
0