結果

問題 No.3171 Color Restoration
ユーザー mint
提出日時 2025-06-27 18:21:45
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 743 bytes
コンパイル時間 2,475 ms
コンパイル使用メモリ 207,176 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2025-06-27 18:21:49
合計ジャッジ時間 3,165 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 = false;
      break;
    }
    z += b;
  }while(next_permutation(s.begin(), s.end()));
  if(z == 1) cout << "Yes" << '\n';
  else cout << "No" << '\n';
  return 0;
}
0