Submission #608795

# Submission time Handle Problem Language Result Execution time Memory
608795 2022-07-27T10:15:05 Z Duy_e Monster Game (JOI21_monster) C++17
0 / 100
231 ms 368 KB
#include "monster.h"

using namespace std;

const long long N = 2e2 + 5;
int ans[N][N];
vector<int> Solve(int n) {

  	vector<int> T(n);
	
	int pos1 = 0, pos2 = 0;
    vector <int> p1, p2;

	for (int i = 0; i < n; i ++) {
		for (int j = 0; j < n; j ++) 
			if (i != j) {
				ans[i][j] = Query(i, j);
				T[i] += ans[i][j];
			}

		if (T[i] == 2) p1.push_back(i);
        if (T[i] == n - 3) p2.push_back(i);
    }

	for (int i = 0; i < n; i ++) {
        if (T[i] == 1) {
            T[i] = 0;
            for (int j: p1) if (ans[i][j]) T[i] = 1;
	    }

        if (T[i] == n - 2) {
            T[i] = n - 1;
            for (int j: p2) if (!ans[i][j]) T[i] = n - 2;
        }
    }

	return T;
}

Compilation message

monster.cpp: In function 'std::vector<int> Solve(int)':
monster.cpp:11:6: warning: unused variable 'pos1' [-Wunused-variable]
   11 |  int pos1 = 0, pos2 = 0;
      |      ^~~~
monster.cpp:11:16: warning: unused variable 'pos2' [-Wunused-variable]
   11 |  int pos1 = 0, pos2 = 0;
      |                ^~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 1 ms 208 KB Output is correct
14 Correct 1 ms 208 KB Output is correct
15 Correct 1 ms 208 KB Output is correct
16 Incorrect 231 ms 368 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 1 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
5 Correct 0 ms 208 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 0 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 1 ms 208 KB Output is correct
10 Correct 1 ms 208 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 1 ms 208 KB Output is correct
14 Correct 1 ms 208 KB Output is correct
15 Correct 1 ms 208 KB Output is correct
16 Incorrect 231 ms 368 KB Wrong Answer [6]
17 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 210 ms 296 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -