Submission #534293

# Submission time Handle Problem Language Result Execution time Memory
534293 2022-03-08T03:22:03 Z Monarchuwu Monster Game (JOI21_monster) C++17
0 / 100
161 ms 568 KB
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;

#include "monster.h"
const int N = 200 + 2;
bool a[N][N], mark[N];
int cnt[2];
vector<int> Solve(int n) {
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < i; ++j)
            a[i][j] = Query(i, j), a[j][i] = a[i][j] ^ 1;

    vector<int> ans(n, 0);
    for (int i = n - 1; i; --i) {
        for (int j = 0; j < n; ++j) if (!mark[j]) {
            cnt[0] = cnt[1] = 0;
            for (int k = 0; k < n; ++k) if (k != j && !mark[k])
                ++cnt[a[j][k]];

            if (cnt[1] == i && cnt[0] == 1) {
                ans[j] = i;
                mark[j] = true;
                break;
            }
        }
    }
    return ans;
}
/**  /\_/\
 *  (= ._.)
 *  / >0  \>1
**/
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 161 ms 568 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -