제출 #891255

#제출 시각아이디문제언어결과실행 시간메모리
891255SorahISAMonster Game (JOI21_monster)C++17
10 / 100
136 ms596 KiB
#ifndef SorahISA #define SorahISA #include SorahISA __FILE__ SorahISA namespace { } /// end of unnamed namespace vector<int> Solve(int N) { vector<int> S(N); vector<int> win(N, 0); for (int i = 0; i < N; ++i) { for (int j = i+1; j < N; ++j) ++win[Query(i, j) ? i : j]; } vector<int> weak, strong; for (int i = 0; i < N; ++i) { if (win[i] == 1) weak.eb(i); if (win[i] == N-2) strong.eb(i); if (1 < win[i] and win[i] < N-2) S[i] = win[i]; } if (Query(weak[0], weak[1])) S[weak[0]] = 0, S[weak[1]] = 1; else S[weak[0]] = 1, S[weak[1]] = 0; if (Query(strong[0], strong[1])) S[strong[0]] = N-2, S[strong[1]] = N-1; else S[strong[0]] = N-1, S[strong[1]] = N-2; return S; } #else #ifdef local #include "C/monster.h" #else #include "monster.h" #endif #pragma GCC optimize("Ofast", "unroll-loops") #include <bits/stdc++.h> using namespace std; using int64 = long long; // #define int int64 using float80 = long double; // #define double float80 using pii = pair<int, int>; template <typename T> using Prior = std::priority_queue<T>; template <typename T> using prior = std::priority_queue<T, vector<T>, greater<T>>; #define eb emplace_back #define ef emplace_front #define ee emplace #define pb pop_back #define pf pop_front #define ALL(x) begin(x), end(x) #define RALL(x) rbegin(x), rend(x) #define SZ(x) ((int)(x).size()) #ifdef local #define fastIO() void() #define debug(...) \ fprintf(stderr, "\u001b[33m"), \ fprintf(stderr, "At [%s], line %d: (%s) = ", __FUNCTION__, __LINE__, #__VA_ARGS__), \ _do(__VA_ARGS__), \ fprintf(stderr, "\u001b[0m") template <typename T> void _do(T &&_t) { cerr << _t << "\n"; } template <typename T, typename ...U> void _do(T &&_t, U &&..._u) { cerr << _t << ", ", _do(_u...); } #else #define fastIO() ios_base::sync_with_stdio(0), cin.tie(0) #define debug(...) void() #endif template <typename T, typename U> bool chmin(T &lhs, U rhs) { return lhs > rhs ? lhs = rhs, 1 : 0; } template <typename T, typename U> bool chmax(T &lhs, U rhs) { return lhs < rhs ? lhs = rhs, 1 : 0; } #endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...