結果

問題 No.3625 Find Superfibonacci Number
コンテスト
ユーザー pengin_2000
提出日時 2026-08-14 22:32:23
言語 C
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
WA  
実行時間 -
コード長 568 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,230 ms
コンパイル使用メモリ 37,316 KB
実行使用メモリ 9,420 KB
最終ジャッジ日時 2026-08-14 22:32:33
合計ジャッジ時間 1,323 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 2 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
void solve()
{
	int i, k, n;
	scanf("%d", &k);
	if (k % 9 > 0)
	{
		if (k > 9)
		{
			n = k / 9;
			k %= 9;
			k += 9;
			printf("%d0%d", (k + 2) / 2, (k - 1) / 2);
			for (i = 1; i < n; i++)
				printf("9");
			printf("\n");
		}
		else
		{
			printf("%d0%d\n", (k + 2) / 2, (k - 1) / 2);
		}
	}
	else
	{
		n = k / 9;
		if (n > 1)
		{
			printf("1908");
			for (i = 2; i < n; i++)
				printf("9");
			printf("\n");
		}
		else
		{
			printf("504\n");
		}
	}
	return;
}
int main()
{
	int t;
	scanf("%d", &t);
	for (; t > 0; t--)
		solve();
	return 0;
}
0