# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
540121 | rk42745417 | Monster Game (JOI21_monster) | C++17 | 184 ms | 300 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "monster.h"
#include <bits/stdc++.h>
using namespace std;
#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using ull = uint64_t;
using uint = uint32_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const ll LINF = ll(4e18) + ll(2e15);
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
namespace {
bool example_variable;
} // namespace
vector<int> Solve(int n) {
vector<int> cnt(n);
for(int i = 0; i < n; i++)
for(int j = i + 1; j < n; j++) {
if(Query(i, j))
cnt[i]++;
else
cnt[j]++;
}
vector<int> ans(n);
for(int i = 0; i < n; i++) {
if(cnt[i] == 1 || cnt[i] == n - 2)
continue;
ans[i] = cnt[i];
}
{
int a = -1, b;
for(int i = 0; i < n; i++) {
if(cnt[i] == 1) {
if(~a)
b = i;
else
a = i;
}
}
if(Query(a, b))
ans[a] = 0, ans[b] = 1;
else
ans[a] = 1, ans[b] = 0;
}
{
int a = -1, b;
for(int i = 0; i < n; i++) {
if(cnt[i] == n - 2) {
if(~a)
b = i;
else
a = i;
}
}
if(Query(a, b))
ans[a] = n - 2, ans[b] = n - 1;
else
ans[a] = n - 1, ans[b] = n - 2;
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |