結果

問題 No.44 DPなすごろく
ユーザー tansunogontansunogon
提出日時 2017-07-25 19:23:24
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 1,165 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 20,224 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-17 23:32:49
合計ジャッジ時間 802 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 0 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 0 ms
6,944 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 0 ms
6,940 KB
testcase_12 AC 1 ms
6,940 KB
testcase_13 AC 0 ms
6,940 KB
testcase_14 AC 1 ms
6,944 KB
testcase_15 AC 0 ms
6,940 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 0 ms
6,944 KB
testcase_19 AC 1 ms
6,940 KB
testcase_20 AC 1 ms
6,940 KB
testcase_21 AC 0 ms
6,940 KB
testcase_22 AC 0 ms
6,940 KB
testcase_23 AC 0 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <string.h>

#if 0
int main()
{
	long long a = 1;
	long long b = 1;
	printf("const char* table[] = {\n");
	printf("\"1\\n\", \"1\\n\", ");
	for (int i = 2; i <= 50; ++i)
	{
		long long c = a + b;
		printf("\"%lld\\n\", ", c);
		a = b;
		b = c;
	}
	printf("\n};");
	return 0;
}
#else
const char* table[] = {
"1\n", "1\n", "2\n", "3\n", "5\n", "8\n", "13\n", "21\n", "34\n", "55\n", "89\n", "144\n", "233\n", "377\n", "610\n", "987\n", "1597\n", "2584\n", "4181\n", "6765\n", "10946\n", "17711\n", "28657\n", "46368\n", "75025\n", "121393\n", "196418\n", "317811\n", "514229\n", "832040\n", "1346269\n", "2178309\n", "3524578\n", "5702887\n", "9227465\n", "14930352\n", "24157817\n", "39088169\n", "63245986\n", "102334155\n", "165580141\n", "267914296\n", "433494437\n", "701408733\n", "1134903170\n", "1836311903\n", "2971215073\n", "4807526976\n", "7778742049\n", "12586269025\n", "20365011074\n", 
};
int main()
{
	char buf[8];
	int n, m;
	n = fgetc(stdin);
	m = fgetc(stdin);
	if (m == '\n')
	{
		n -= '0';
	}
	else
	{
		n -= '0';
		n *= 10;
		m -= '0';
		n += m;
	}
	fwrite(table[n], strlen(table[n]), 1, stdout);
	return 0;
}
#endif
0