結果
| 問題 |
No.3171 Color Restoration
|
| コンテスト | |
| ユーザー |
mint
|
| 提出日時 | 2025-06-27 18:11:19 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 745 bytes |
| コンパイル時間 | 2,253 ms |
| コンパイル使用メモリ | 206,892 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-27 18:11:23 |
| 合計ジャッジ時間 | 3,603 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
vector<string> o = {"gray","brown","green","cyan","blue","yellow","orange","red"};
vector<string> p = {"gray","green","blue","yellow","red"};
vector<string> q = {"gray","green","cyan","blue","violet","orange","red"};
vector<string> s(3);
for(auto &e: s) cin >> e;
sort(s.begin(), s.end());
int z = 0;
do{
bool b = true;
if(count(o.begin(), o.end(), s[0]) == 0 || count(p.begin(), p.end(), s[1]) == 0|| count(q.begin(), q.end(), s[2]) == 0){
b = true;
break;
}
if(b) ++z;
}while(next_permutation(s.begin(), s.end()));
if(z == 1) cout << "Yes" << '\n';
else cout << "No" << '\n';
return 0;
}
mint