結果
| 問題 |
No.3323 岩井星式ジャンケン
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-11-03 00:03:02 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,443 bytes |
| コンパイル時間 | 3,006 ms |
| コンパイル使用メモリ | 286,944 KB |
| 実行使用メモリ | 7,724 KB |
| 最終ジャッジ日時 | 2025-11-03 00:03:08 |
| 合計ジャッジ時間 | 4,860 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | AC * 6 WA * 20 |
ソースコード
#include <bits/stdc++.h>
// #include <atcoder/fenwicktree.hpp>
// #include <atcoder/segtree.hpp>
// #include <atcoder/modint.hpp>
// #include <atcoder/dsu.hpp>
// #include <atcoder/lazysegtree.hpp>
// using namespace atcoder;
using namespace std;
using ll = long long;
using ull = unsigned long long;
template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<>>;
ll ll_min = numeric_limits<ll>::min();
ll ll_max = numeric_limits<ll>::max();
ll ALPHABET_N = 26;
// using mint = modint998244353;
#define rep(i, n) for (ll i = (ll)0; i < (ll)n; i++)
#define rep_(i, k, n) for (ll i = (ll)k; i < (ll)n; i++)
#define all(a) a.begin(), a.end()
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll n, m;
cin >> n >> m;
vector<string> S(n);
rep(i, n) cin >> S[i];
string ans = "-1";
bool win = false;
rep(i, m)
{
set<char> st;
rep(j, n)
{
st.insert(S[j][i]);
}
if (st.size() == 1)
{
char c = *st.begin();
if (c == 'G')
ans += 'P';
if (c == 'C')
ans += 'G';
if (c == 'P')
ans += 'C';
win = true;
}
else if (st.size() == 2)
{
if (st == set<char>({'P', 'G'}))
ans += 'P';
if (st == set<char>({'P', 'C'}))
ans += 'C';
if (st == set<char>({'G', 'C'}))
ans += 'G';
win = true;
}
else
{
ans += "G";
break;
}
}
if(win)
cout << ans << endl;
else cout<<"-1"<<endl;
return 0;
}