# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1145365 | lightentheshadow | 도서관 (JOI18_library) | C++20 | 120 ms | 432 KiB |
#include <bits/stdc++.h>
#include "library.h"
using namespace std;
bool found[1005];
void Solve(int n) {
vector<int> ans; ans.clear();
if (n <= 2) {
for (int i = 1; i <= n; i++)
ans.push_back(i);
Answer(ans);
return ;
}
vector<int> ask;
for (int i = 1; i <= n; i++)
ask.push_back(0);
/// Find one of the sides
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= n; j++)
if (j == i) ask[j - 1] = 0;
else ask[j - 1] = 1;
int res = Query(ask);
if (res == 1) {
ans.push_back(i);
found[i] = 1;
break;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |