結果

問題 No.785 色食い虫
ユーザー pengin_2000
提出日時 2020-02-20 18:24:25
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 651 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 30,080 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-08 19:07:26
合計ジャッジ時間 1,565 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
#include<string.h>
int main()
{
	char r[102], g[102], b[102];
	scanf("%s%s%s", r, g, b);
	int ans = 1;
	int c;
	int i, n;
	if (r[0] == 'N')
		ans *= 16 * 16;
	else
	{
		c = 1;
		n = strlen(r);
		for (i = 0; i < n; i++)
			if (r[i] == ',')
				c++;
		ans *= (16 - c) * (16 - c);
	}
	if (g[0] == 'N')
		ans *= 16 * 16;
	else
	{
		c = 1;
		n = strlen(g);
		for (i = 0; i < n; i++)
			if (g[i] == ',')
				c++;
		ans *= (16 - c) * (16 - c);
	}
	if (b[0] == 'N')
		ans *= 16 * 16;
	else
	{
		c = 1;
		n = strlen(b);
		for (i = 0; i < n; i++)
			if (b[i] == ',')
				c++;
		ans *= (16 - c) * (16 - c);
	}
	printf("%d\n", ans);
	return 0;
}
0