| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1363591 | biserailieva | Guessing Game (EGOI23_guessinggame) | C++20 | 366 ms | 1204 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int P, N;
cin >> P >> N;
if (P == 1)
{
cout << 2 << endl;
for (int i = 0; i < N - 1; i++)
{
int idx;
cin >> idx;
if (i < (N - 1) / 2)
cout << 1 << endl;
else
cout << 2 << endl;
}
}
else
{
vector<int> A(N);
for (int i = 0; i < N; i++)
cin >> A[i];
map<int, vector<int>> pos;
for (int i = 0; i < N; i++)
{
pos[A[i]].push_back(i);
}
vector<int> ans;
for (auto &p : pos)
{
if (p.second.size() >= 2)
{
ans.push_back(p.second[0]);
ans.push_back(p.second[1]);
break;
}
}
if (ans.size() < 2)
{
ans = {0, 0};
}
cout << ans[0] << " " << ans[1] << "\n";
}
return 0;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
