結果
| 問題 |
No.3171 Color Restoration
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-06 21:27:23 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 658 bytes |
| コンパイル時間 | 2,502 ms |
| コンパイル使用メモリ | 208,516 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-06 21:27:27 |
| 合計ジャッジ時間 | 3,634 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int N = 2000008, MOD = 998244353, INF = 0x3f3f3f3f;
ll res;
int n, m, cnt, w[N];
int main() {
set<string> st[4];
st[1] = {"gray","brown","green","cyan","blue","yellow","orange","red"},\
st[2] = {"gray","green","blue","yellow","red"}, \
st[3] = {"gray","green","cyan","blue","violet","orange","red"};
string s[4];
for (int i = 1; i < 4; i++) cin >> s[i];
sort(s + 1, s + 4);
int c = 0;
do {
c += st[1].count(s[1]) && st[2].count(s[2]) && st[3].count(s[3]);
} while (next_permutation(s + 1, s + 4));
puts(c == 1 ? "Yes" : "No");
return 0;
}