結果

問題 No.3171 Color Restoration
ユーザー daiota
提出日時 2025-06-07 04:13:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 864 bytes
コンパイル時間 2,084 ms
コンパイル使用メモリ 173,876 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-07 04:13:11
合計ジャッジ時間 3,875 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(ll i=0;i<ll(n);i++)










int main(void){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
	ll i,j;



	vector<string> n={"gray","brown","green","cyan","blue","yellow","orange","red"};
	vector<string> w={"gray","green","blue","yellow","red"};
	vector<string> h={"gray","green","cyan","blue","violet","orange","red"};


	vector<string> s(3);
	cin >> s[0] >> s[1] >> s[2];


	sort(s.begin(),s.end());

	ll c=0;
do{


	ll d=0;
	REP(i,8){
		if(s[0]==n[i]){
			d++;
			break;
		}
	}

	REP(i,5){
		if(s[1]==w[i]){
			d++;
			break;
		}
	}

	REP(i,7){
		if(s[2]==h[i]){
			d++;
			break;
		}
	}

	if(d==3) c++;



}while(next_permutation(s.begin(),s.end()));



	if(c==1) cout << "Yes" << endl;
	else cout << "No" << endl;






	return 0;

}





0