답안 #619729

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
619729 2022-08-02T15:16:46 Z APROHACK Monster Game (JOI21_monster) C++17
10 / 100
234 ms 4184 KB
#include "monster.h"
#include <bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
#define pb push_back
using namespace std;
namespace {

bool example_variable;

}  // namespace
vector<int>value;
std::vector<int> Solve(int N) {
  std::vector<int> T(N);
  int n = N;
  vector<int>ceroouno, nn;
  
  int wins[N][N];
  value.resize(N);
  memset(wins, -1, sizeof wins);
  for(int i = 0 ; i < n ; i++){
    for(int j = 0 ; j < n ; j++){
      if(i==j)continue;
      bool ans;
      if(wins[i][j]!=-1){
        ans = wins[i][j];
      }else{
        ans = Query(i, j);
        wins[i][j]=ans, wins[j][i]=!ans;
      }
      if(ans)value[i]++;
    }
    if(value[i]==1){
        ceroouno.pb(i);
        //cout << i << " a \n"; 
      }else if(value[i] == n-2){
        nn.pb(i);
        //cout << i << " b \n"; 
      }
  }
  if(wins[ceroouno[0]][ceroouno[1]]){
    value[ceroouno[0]]=0;
  }else value[ceroouno[1]]=0;
  if(wins[nn[0]][nn[1]]){
    value[nn[1]]=n-1;
  }else value[nn[0]]=n-1;

  return value;
}

Compilation message

monster.cpp:10:6: warning: '{anonymous}::example_variable' defined but not used [-Wunused-variable]
   10 | bool example_variable;
      |      ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 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 0 ms 292 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 0 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 Correct 72 ms 428 KB Output is correct
17 Correct 154 ms 428 KB Output is correct
18 Correct 147 ms 428 KB Output is correct
19 Correct 121 ms 436 KB Output is correct
20 Correct 160 ms 440 KB Output is correct
21 Correct 1 ms 208 KB Output is correct
22 Correct 1 ms 208 KB Output is correct
23 Correct 1 ms 208 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 208 KB Output is correct
26 Correct 131 ms 436 KB Output is correct
27 Correct 0 ms 208 KB Output is correct
28 Correct 1 ms 208 KB Output is correct
29 Correct 0 ms 208 KB Output is correct
30 Correct 0 ms 208 KB Output is correct
31 Correct 1 ms 208 KB Output is correct
32 Correct 161 ms 436 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 0 ms 208 KB Output is correct
5 Correct 1 ms 208 KB Output is correct
6 Correct 1 ms 208 KB Output is correct
7 Correct 1 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 0 ms 292 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
12 Correct 1 ms 208 KB Output is correct
13 Correct 0 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 Correct 72 ms 428 KB Output is correct
17 Correct 154 ms 428 KB Output is correct
18 Correct 147 ms 428 KB Output is correct
19 Correct 121 ms 436 KB Output is correct
20 Correct 160 ms 440 KB Output is correct
21 Correct 1 ms 208 KB Output is correct
22 Correct 1 ms 208 KB Output is correct
23 Correct 1 ms 208 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 1 ms 208 KB Output is correct
26 Correct 131 ms 436 KB Output is correct
27 Correct 0 ms 208 KB Output is correct
28 Correct 1 ms 208 KB Output is correct
29 Correct 0 ms 208 KB Output is correct
30 Correct 0 ms 208 KB Output is correct
31 Correct 1 ms 208 KB Output is correct
32 Correct 161 ms 436 KB Output is correct
33 Incorrect 230 ms 4176 KB Wrong Answer [6]
34 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 234 ms 4184 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -