結果
| 問題 |
No.3171 Color Restoration
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-06-06 21:26:54 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,554 bytes |
| コンパイル時間 | 2,641 ms |
| コンパイル使用メモリ | 208,072 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2025-06-06 21:26:58 |
| 合計ジャッジ時間 | 3,010 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using i32 = int;
using i64 = long long;
using f64 = long double;
using i128 = __int128_t;
using p2 = pair<i64, i64>;
using el = tuple<i64, i64, i64>;
void _main();
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
_main();
}
i64 pow(i64 x, i64 n) {
i64 res = 1;
i64 t = x;
while (n > 0) {
if (n & 1) {
res = res * t;
}
t = t * t;
}
return res;
}
void _main() {
string s1, s2, s3;
cin >> s1 >> s2 >> s3;
vector<string> s = {s1, s2, s3};
vector<string> a1 = {"gray","brown","green","cyan","blue","yellow","orange","red"};
vector<string> a2 = {"gray","green","blue","yellow","red"};
vector<string> a3 = {"gray","green","cyan","blue","violet","orange","red"};
vector<vector<string>> A = {a1, a2, a3};
vector<i64> ord = {0, 1, 2};
i64 ans = 0;
for (i64 i = 0; i < a1.size(); i++) {
for (i64 j = 0; j < a2.size(); j++) {
for (i64 k = 0; k < a3.size(); k++) {
if (a1[i] == s1 && a2[j] == s2 && a3[k] == s3) {
ans++;
} else if (a1[i] == s1 && a2[j] == s3 && a3[k] == s2) {
ans++;
} else if (a1[i] == s2 && a2[j] == s1 && a3[k] == s3) {
ans++;
} else if (a1[i] == s2 && a2[j] == s3 && a3[k] == s2) {
ans++;
} else if (a1[i] == s3 && a2[j] == s1 && a3[k] == s2) {
ans++;
} else if (a1[i] == s3 && a2[j] == s2 && a3[k] == s1) {
ans++;
}
}
}
}
if (ans == 1) {
cout << "Yes\n";
} else {
cout << "No\n";
}
}