답안 #423490

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
423490 2021-06-11T07:59:57 Z 최서현(#7497) Monster Game (JOI21_monster) C++17
10 / 100
295 ms 288 KB
#include "monster.h"
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#define pii pair<int, int>
#define piii pair<int, pii>
#define pll pair<long long, long long>
#define plll pair<long long, pll>
#define tiii tuple<int, int, int>
#define tiiii tuple<int, int, int, int>
#define ff first
#define ss second
#define ee ss.ff
#define rr ss.ss
#define DEBUG
const int INF = (int)1e9 + 7;

using namespace std;

namespace {

}

vector<int> Solve(int N)
{
    vector<int> ls[N];
    int cnt[N]{};
    for(int i = 0; i < N; ++i)
    {
        for(int j = 0; j < i; ++j)
        {
            if(Query(i, j)) ++cnt[i];
            else ++cnt[j];
        }
    }
    for(int i = 0; i < N; ++i) ls[cnt[i]].push_back(i);

    vector<int> ret;
    if(Query(ls[1][0], ls[1][1])) ret.push_back(ls[1][0]), ret.push_back(ls[1][1]);
    else ret.push_back(ls[1][1]), ret.push_back(ls[1][0]);
    for(int i = 2; i < N - 2; ++i) ret.push_back(ls[i][0]);
    if(Query(ls[N - 2][0], ls[N - 2][1])) ret.push_back(ls[N - 2][0]), ret.push_back(ls[N - 2][1]);
    else ret.push_back(ls[N - 2][1]), ret.push_back(ls[N - 2][0]);

    vector<int> rret(N);
    for(int i = 0; i < N; ++i) rret[ret[i]] = i;

    return rret;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 0 ms 200 KB Output is correct
3 Correct 0 ms 200 KB Output is correct
4 Correct 0 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 0 ms 200 KB Output is correct
9 Correct 1 ms 200 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 0 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 1 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 193 ms 264 KB Output is correct
17 Correct 163 ms 260 KB Output is correct
18 Correct 232 ms 264 KB Output is correct
19 Correct 234 ms 268 KB Output is correct
20 Correct 221 ms 264 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 0 ms 200 KB Output is correct
24 Correct 1 ms 200 KB Output is correct
25 Correct 1 ms 200 KB Output is correct
26 Correct 232 ms 260 KB Output is correct
27 Correct 1 ms 200 KB Output is correct
28 Correct 1 ms 200 KB Output is correct
29 Correct 1 ms 200 KB Output is correct
30 Correct 2 ms 200 KB Output is correct
31 Correct 1 ms 200 KB Output is correct
32 Correct 245 ms 260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 0 ms 200 KB Output is correct
3 Correct 0 ms 200 KB Output is correct
4 Correct 0 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 0 ms 200 KB Output is correct
9 Correct 1 ms 200 KB Output is correct
10 Correct 1 ms 200 KB Output is correct
11 Correct 1 ms 200 KB Output is correct
12 Correct 0 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 1 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Correct 193 ms 264 KB Output is correct
17 Correct 163 ms 260 KB Output is correct
18 Correct 232 ms 264 KB Output is correct
19 Correct 234 ms 268 KB Output is correct
20 Correct 221 ms 264 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 0 ms 200 KB Output is correct
24 Correct 1 ms 200 KB Output is correct
25 Correct 1 ms 200 KB Output is correct
26 Correct 232 ms 260 KB Output is correct
27 Correct 1 ms 200 KB Output is correct
28 Correct 1 ms 200 KB Output is correct
29 Correct 1 ms 200 KB Output is correct
30 Correct 2 ms 200 KB Output is correct
31 Correct 1 ms 200 KB Output is correct
32 Correct 245 ms 260 KB Output is correct
33 Incorrect 174 ms 284 KB Wrong Answer [6]
34 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 295 ms 288 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -