# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619725 | APROHACK | Monster Game (JOI21_monster) | C++17 | 159 ms | 4184 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |