結果
問題 | No.587 七対子 |
ユーザー |
![]() |
提出日時 | 2019-09-18 22:44:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,208 bytes |
コンパイル時間 | 927 ms |
コンパイル使用メモリ | 88,428 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-19 20:00:53 |
合計ジャッジ時間 | 1,972 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 34 WA * 1 |
ソースコード
#include<iostream> #include<algorithm> #include <vector> #include<cmath> #include<iomanip> #include<queue> using namespace std; typedef long long int lint; int main() { string S; cin >> S; vector<char>vec(14); for (int ia = 0; ia < 13; ia++) { vec.at(ia) = S.at(ia); } vector<char>vecc(14); vector<char>vecb(26); vecb = { 'q','w','e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'l', 'k', 'j', 'h','g', 'f', 'd', 's', 'a', 'z', 'x', 'c', 'v', 'b', 'n', 'm' }; int cnta = 0; int cntb = 0; for (int ib = 0; ib < 26; ib++) { for (int id = 0; id < 14; id++) { vecc.at(id) = vec.at(id); } vecc.at(13) = vecb.at(ib); sort(vecc.begin(), vecc.end()); if (vecc.at(0) == vecc.at(1) && vecc.at(2) == vecc.at(3) && vecc.at(4) == vecc.at(5) && vecc.at(6) == vecc.at(7) && vecc.at(8) == vecc.at(9) && vecc.at(10) == vecc.at(11) && vecc.at(12) == vecc.at(13) && vecc.at(1) != vecc.at(2) && vecc.at(3) != vecc.at(4) && vecc.at(5) != vecc.at(6) && vecc.at(7) != vecc.at(8) && vecc.at(9) != vecc.at(10) && vecc.at(11) != vecc.at(12)) { cnta += ib; break; } } if (cnta) { cout << vecb.at(cnta) << endl; } else { cout << "Impossible" << endl; } }