답안 #864303

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
864303 2023-10-22T11:04:42 Z vjudge1 Monster Game (JOI21_monster) C++17
10 / 100
106 ms 1392 KB
#include <bits/stdc++.h>
#include "monster.h"
using namespace std;

/*vector<int> a;

bool Query(int x, int y)
{
    cout << "? " << x << " " << y << '\n';
    bool win=false;
    if (a[x]-a[y]>1 || a[y]-a[x]==1)
        win=true;
    cout << win << '\n';

    return win;
}*/

vector<int> Solve(int n)
{
    int wins[n]={0};
    bool outcome[n][n];
    vector<int> strength(n);
    for (int i=0; i<n; i++)
        for (int j=i+1; j<n; j++)
        {
            outcome[i][j]=Query(i, j);
            if (outcome[i][j]==true)
                wins[i]=wins[i]+1;
            else
                wins[j]=wins[j]+1;
        }
    /*cout << "wins\n";
    for (int i=0; i<n; i++)
        cout << wins[i] << " ";
    cout << '\n';*/
    for (int i=0; i<n; i++)
        strength[i]=wins[i];
    for (int i=0; i<n; i++)
        for (int j=i+1; j<n; j++)
        {
            if (wins[i]==n-2 && wins[j]==n-2)
            {
                strength[i]=n-1;
                strength[j]=n-2;
                if (outcome[i][j]==true)
                    swap(strength[i], strength[j]);

            }
            if (wins[i]==1 && wins[j]==1)
            {
                strength[i]=1;
                strength[j]=0;
                if (outcome[i][j]==true)
                    swap(strength[i], strength[j]);

            }
        }

    return strength;
}

/*int main()
{
    a={3, 1, 4, 2, 0};
    vector<int> t=Solve(5);
    for (auto x : t)
        cout << x << " ";

    return 0;
}*/
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 78 ms 344 KB Output is correct
17 Correct 97 ms 344 KB Output is correct
18 Correct 106 ms 344 KB Output is correct
19 Correct 87 ms 344 KB Output is correct
20 Correct 89 ms 352 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 0 ms 344 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 91 ms 344 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 344 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 82 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 0 ms 344 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
5 Correct 0 ms 344 KB Output is correct
6 Correct 0 ms 344 KB Output is correct
7 Correct 0 ms 344 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 Correct 0 ms 344 KB Output is correct
12 Correct 0 ms 344 KB Output is correct
13 Correct 0 ms 344 KB Output is correct
14 Correct 0 ms 344 KB Output is correct
15 Correct 0 ms 344 KB Output is correct
16 Correct 78 ms 344 KB Output is correct
17 Correct 97 ms 344 KB Output is correct
18 Correct 106 ms 344 KB Output is correct
19 Correct 87 ms 344 KB Output is correct
20 Correct 89 ms 352 KB Output is correct
21 Correct 0 ms 348 KB Output is correct
22 Correct 0 ms 344 KB Output is correct
23 Correct 0 ms 344 KB Output is correct
24 Correct 0 ms 344 KB Output is correct
25 Correct 0 ms 344 KB Output is correct
26 Correct 91 ms 344 KB Output is correct
27 Correct 1 ms 344 KB Output is correct
28 Correct 0 ms 344 KB Output is correct
29 Correct 0 ms 344 KB Output is correct
30 Correct 0 ms 344 KB Output is correct
31 Correct 0 ms 344 KB Output is correct
32 Correct 82 ms 344 KB Output is correct
33 Incorrect 100 ms 1392 KB Wrong Answer [6]
34 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 104 ms 1392 KB Wrong Answer [6]
2 Halted 0 ms 0 KB -