結果
問題 | No.250 atetubouのzetubou |
ユーザー |
![]() |
提出日時 | 2016-08-06 20:27:13 |
言語 | Fortran (gFortran 14.2.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,002 bytes |
コンパイル時間 | 1,426 ms |
コンパイル使用メモリ | 31,872 KB |
実行使用メモリ | 20,652 KB |
最終ジャッジ日時 | 2024-11-07 04:17:35 |
合計ジャッジ時間 | 48,362 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | AC * 12 TLE * 2 -- * 6 |
ソースコード
recursive function solve(X, D, memo) result(res)integer*8::res, D,X,memo(1500,1500)if(memo(X,D).eq.0_8) thenmemo(X,D) = solve(X,D-1,memo) + solve(X-1, D, memo)end if! print '("X:",i5,", D:",i5,", memo:",i5)',X,D,memo(X,D)res = memo(X,D)if(res.gt.10**15_8) thenmemo(X:1500,D:1500)=10**15_8end ifreturnend function solveprogram mainimplicit nonetype probleminteger*8::D,X,Tend type probleminterfacerecursive function solve(X, D, memo) result(res)integer*8::res, D,X,memo(1500,1500)end function solveend interfaceinteger*8::Q,i,j,k,tmpinteger*8::qd,qx,qttype(problem)::P(10**4)integer*8::D,T,memo(1500,1500) !X,Ddata memo/2250000*0/read *, Qread *, P(1:Q)do i=1,1500memo(1,i) = iend domemo(:,1) = 1do i=1,Qtmp = solve(P(i)%X, P(i)%D, memo)if(tmp.gt.P(i)%T) thenprint '(a)', "ZETUBOU"elseprint '(a)', "AC"end ifend doend program main