結果

問題 No.534 フィボナッチフィボナッチ数
ユーザー fjafjafjafjafjafja
提出日時 2017-07-17 23:54:42
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 5,126 ms
コンパイル使用メモリ 74,724 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2024-04-17 00:08:31
合計ジャッジ時間 9,625 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
53,960 KB
testcase_01 AC 113 ms
52,888 KB
testcase_02 AC 126 ms
54,156 KB
testcase_03 AC 125 ms
54,192 KB
testcase_04 AC 115 ms
53,520 KB
testcase_05 AC 127 ms
54,104 KB
testcase_06 AC 127 ms
54,012 KB
testcase_07 AC 115 ms
53,048 KB
testcase_08 AC 113 ms
53,036 KB
testcase_09 AC 127 ms
54,056 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
testcase_39 RE -
testcase_40 RE -
testcase_41 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class N534
{
	public static int k=0;
	public static int buf=0;


	public static void main(String[] args)
	{
		int X=0;
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		//X=N534.fib(N534.fib(n))%(int)Math.pow(10, 9)+7;
		X=N534.fib(N534.fib(n));
		System.out.println(X);
	}

	public static int fib(int n)
	{
		int prefib=0;
		int fib=1;
		if(n==0)
		{return prefib;}
		if(n==1)
		{return fib;}

		for(int i=1;i<n;i++)
		{
		buf=fib;
		fib=prefib+fib;
		prefib=buf;
		}
		return fib;
	}

}
0