Submission #619725

#TimeUsernameProblemLanguageResultExecution timeMemory
619725APROHACKMonster Game (JOI21_monster)C++17
0 / 100
159 ms4184 KiB
#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)

monster.cpp:10:6: warning: '{anonymous}::example_variable' defined but not used [-Wunused-variable]
   10 | bool example_variable;
      |      ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...