Submission #534299

# Submission time Handle Problem Language Result Execution time Memory
534299 2022-03-08T03:35:13 Z Monarchuwu Monster Game (JOI21_monster) C++17
10 / 100
224 ms 288 KB
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;

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

    vector<int> ans(n, 0), vec1, vecn;
    for (int i = 0; i < n; ++i) {
        if (cnt[i] == n - 2) vecn.push_back(i);
        else if (cnt[i] == 1) vec1.push_back(i);
        else ans[i] = cnt[i];
    }

    if (Query(vec1[0], vec1[1]))
        ans[vec1[0]] = 0, ans[vec1[1]] = 1;
    else ans[vec1[0]] = 1, ans[vec1[1]] = 0;

    if (Query(vecn[0], vecn[1]))
        ans[vecn[0]] = n - 2, ans[vecn[1]] = n - 1;
    else ans[vecn[0]] = n - 1, ans[vecn[1]] = n - 2;

    return ans;
}
/**  /\_/\
 *  (= ._.)
 *  / >0  \>1
**/
# 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 284 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 276 KB Output is correct
8 Correct 1 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 1 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 173 ms 200 KB Output is correct
17 Correct 144 ms 200 KB Output is correct
18 Correct 194 ms 200 KB Output is correct
19 Correct 224 ms 200 KB Output is correct
20 Correct 159 ms 200 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 200 KB Output is correct
24 Correct 1 ms 200 KB Output is correct
25 Correct 1 ms 276 KB Output is correct
26 Correct 198 ms 200 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 1 ms 200 KB Output is correct
31 Correct 1 ms 288 KB Output is correct
32 Correct 159 ms 200 KB Output is correct
# 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 284 KB Output is correct
6 Correct 1 ms 200 KB Output is correct
7 Correct 1 ms 276 KB Output is correct
8 Correct 1 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 1 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 173 ms 200 KB Output is correct
17 Correct 144 ms 200 KB Output is correct
18 Correct 194 ms 200 KB Output is correct
19 Correct 224 ms 200 KB Output is correct
20 Correct 159 ms 200 KB Output is correct
21 Correct 1 ms 200 KB Output is correct
22 Correct 1 ms 200 KB Output is correct
23 Correct 1 ms 200 KB Output is correct
24 Correct 1 ms 200 KB Output is correct
25 Correct 1 ms 276 KB Output is correct
26 Correct 198 ms 200 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 1 ms 200 KB Output is correct
31 Correct 1 ms 288 KB Output is correct
32 Correct 159 ms 200 KB Output is correct
33 Runtime error 199 ms 284 KB Execution killed with signal 11
34 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 165 ms 272 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -