結果
| 問題 | No.3418 【絶望】30個並列ごちゃ混ぜHit&Blowで遊ぼう! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-12-25 01:24:15 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,796 bytes |
| 記録 | |
| コンパイル時間 | 2,981 ms |
| コンパイル使用メモリ | 291,792 KB |
| 実行使用メモリ | 26,236 KB |
| スコア | 0 |
| 平均クエリ数 | 1.08 |
| 最終ジャッジ日時 | 2025-12-25 01:29:32 |
| 合計ジャッジ時間 | 10,753 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 100 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
bool check(string s) {
sort(s.begin(), s.end());
for (int i = 1; i < s.size(); i++) {
if (s[i - 1] == s[i]) {
return false;
}
}
return true;
}
int main() {
std::random_device seed_gen;
std::uint32_t seed = seed_gen();
std::default_random_engine engine(seed);
vector<string> s;
for (int i = 0; i <= 99999; i++) {
int v = i;
string cur;
for (int j = 0; j < 5; j++) {
cur.push_back('0' + v % 10);
v /= 10;
}
reverse(cur.begin(), cur.end());
if (check(cur)) {
s.push_back(cur);
}
}
int t = 0;
while (s.size()) {
std::uniform_int_distribution<> dist(0, s.size() - 1);
string nx = s[dist(engine)];
cout << nx << "\n";
fflush(stdout);
vector<pair<int, int>> hb(30);
for (auto &nx : hb) {
cin >> nx.first >> nx.second;
}
if (hb[0].first == 5) {
return 0;
}
hb.resize(30 - t);
if (hb.back().first == 5) {
t++;
hb.resize(30 - t);
}
vector<string> ns;
for (string x : s) {
pair<int, int> p = {0, 0};
for (char c : x) {
if (nx.find(c) < 5) {
p.second;
}
}
for (int i : std::ranges::iota_view(0, 5)) {
if (nx[i] == x[i]) {
p.first++;
p.second--;
}
}
for (auto q : hb) {
if (q == p) {
ns.push_back(x);
break;
}
}
}
s.swap(ns);
}
}