結果

問題 No.785 色食い虫
ユーザー ohreitetsuohreitetsu
提出日時 2019-03-27 17:31:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,000 bytes
コンパイル時間 554 ms
コンパイル使用メモリ 66,928 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 10:02:38
合計ジャッジ時間 1,469 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <string>
using namespace std;
typedef long long LL;
int main(int argc, char* argv[])
{
	int r[16],g[16],b[16],i;

	string R,G,B;
	cin>>R>>G>>B;
	for (i=0;i<16;i++){
		r[i]=0;
		g[i]=0;
		b[i]=0;
	}
	if (R.compare("NONE")){
		for (i=0;i<R.size();i++){
			if (R[i]==','){
				continue;
			}
			if (R[i]>='0' && R[i]<='9'){
				r[R[i]-'0']=1;
			}else{
				r[R[i]-'A'+10]=1;
			}
		}
	}
	if (G.compare("NONE")){
		for (i=0;i<G.size();i++){
			if (G[i]==','){
				continue;
			}
			if (G[i]>='0' && G[i]<='9'){
				g[G[i]-'0']=1;
			}else{
				g[G[i]-'A'+10]=1;
			}
		}
	}
	if (B.compare("NONE")){
		for (i=0;i<B.size();i++){
			if (B[i]==','){
				continue;
			}
			if (B[i]>='0' && B[i]<='9'){
				b[B[i]-'0']=1;
			}else{
				b[B[i]-'A'+10]=1;
			}
		}
	}
	int rNum=0,gNum=0,bNum=0;
	for (i=0;i<16;i++){
		rNum+=r[i];
		gNum+=g[i];
		bNum+=b[i];
	}
	rNum=16-rNum;
	gNum=16-gNum;
	bNum=16-bNum;
	LL ans=1;
	ans=rNum*rNum*gNum*gNum*bNum*bNum;
	cout<<ans<<endl;
	return 0;
}
0