Submission #423484

# Submission time Handle Problem Language Result Execution time Memory
423484 2021-06-11T07:58:15 Z 최서현(#7497) Monster Game (JOI21_monster) C++17
0 / 100
267 ms 284 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];
    for(int i = 0; i < N; ++i)
    {
        int cnt = 0;
        for(int j = 0; j < N; ++j) if(i != j)
        {
            if(Query(i, j)) ++cnt;
        }
        ls[cnt].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;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 0 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 0 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 1 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 2 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Incorrect 248 ms 264 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Output is correct
2 Correct 1 ms 200 KB Output is correct
3 Correct 1 ms 200 KB Output is correct
4 Correct 1 ms 200 KB Output is correct
5 Correct 1 ms 200 KB Output is correct
6 Correct 0 ms 200 KB Output is correct
7 Correct 1 ms 200 KB Output is correct
8 Correct 1 ms 200 KB Output is correct
9 Correct 0 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 1 ms 200 KB Output is correct
13 Correct 1 ms 200 KB Output is correct
14 Correct 2 ms 200 KB Output is correct
15 Correct 1 ms 200 KB Output is correct
16 Incorrect 248 ms 264 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 267 ms 284 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -