結果

問題 No.3487 Restricted Shiritori
コンテスト
ユーザー pengin_2000
提出日時 2026-04-01 22:02:28
言語 C
(gcc 15.3.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 2,000 ms
+ 854µs
コード長 307 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,327 ms
コンパイル使用メモリ 35,072 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-16 13:17:52
合計ジャッジ時間 2,585 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
int main()
{
	char s[2], e[2];
	int n;
	scanf("%s%s", s, e);
	scanf("%d", &n);
	int i;
	if (n == 1)
	{
		if (s[0] == e[0])
			printf("%c\n", s[0]);
		else
			printf("-1\n");
	}
	else
	{
		printf("%c", s[0]);
		for (i = 2; i < n; i++)
			printf("a");
		printf("%c\n", e[0]);
	}
	return 0;
}
0