답안 #846902

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
846902 2023-09-08T15:51:55 Z Abito Monster Game (JOI21_monster) C++17
0 / 100
2 ms 600 KB
#include "monster.h"
#include <bits/stdc++.h>
#define elif else if
#define pb push_back
using namespace std;
const int N=205;
int n,s[N],in[N],out[N];
bool b[N][N],adj[N][N];
namespace {

bool example_variable;

}  // namespace
std::vector<int> Solve(int N) {
    n=N;
    for (int i=0;i<n;i++){
        for (int j=i+1;j<n;j++){
            b[i][j]=Query(i,j);
            b[j][i]=!b[i][j];
        }
    }
    for (int i=0;i<n;i++){
        for (int j=0;j<n;j++) cout<<b[i][j];
        cout<<endl;
    }
    for (int i=0;i<n;i++){
        for (int j=0;j<n;j++){
            if (!b[i][j]) continue;
            for (int k=0;k<n;k++){
                if (!b[i][k] || !b[k][j]) continue;
                adj[i][j]=true;
                in[j]++;
                out[i]++;
                //cout<<i<<' '<<k<<' '<<j<<endl;
                break;
            }
        }
    }
    for (int i=0;i<n;i++) s[i]=out[i]+1;
    for (int i=0;i<n;i++){
        for (int j=i+1;j<n;j++){
            if (out[i]!=out[j]) continue;
            if (in[i]<in[j]) s[j]--;
            else s[i]--;
        }
    }vector<int> ans;
    for (int i=0;i<n;i++) ans.pb(s[i]);
    return ans;
}

Compilation message

monster.cpp:11:6: warning: '{anonymous}::example_variable' defined but not used [-Wunused-variable]
   11 | bool example_variable;
      |      ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Wrong Answer [0]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 344 KB Wrong Answer [0]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 600 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -