답안 #771177

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
771177 2023-07-02T14:27:37 Z gagik_2007 Monster Game (JOI21_monster) C++17
10 / 100
162 ms 208 KB
#include "monster.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

ll ttt;
const ll INF=1e18;
const ll MOD=1e9+7;
const ll N=3e5+7;
ll n,m,k;

vector<int> Solve(int NN) {
    vector<int> a(NN);
    n=NN;
    if(n<=200){
        int oo=-1,ot=-1,to=-1,tt=-1;
        vector<int>cnt(n, 0);
        for(int i=0;i<n;i++){
            for(int j=i+1;j<n;j++){
                bool res=Query(i,j);
                if(res){
                    cnt[i]++;
                }
                else {
                    cnt[j]++;
                }
            }
            if(cnt[i]==1){
                if(oo==-1)oo=i;
                else ot=i;
            }
            else if(cnt[i]==n-2){
                if(to==-1)to=i;
                else tt=i;
            }
            else{
                a[i]=cnt[i];
            }
        }
        // cout<<oo<<" "<<ot<<" "<<to<<" "<<tt<<endl;
        if(Query(oo,ot)){
            a[oo]=0,a[ot]=1;
        }
        else{
            a[oo]=1,a[ot]=0;
        }
        if(Query(to,tt)){
            a[to]=n-2,a[tt]=n-1;
        }
        else{
            a[to]=n-1,a[tt]=n-2;
        }
    }
    return a;
}
# 결과 실행 시간 메모리 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 0 ms 208 KB Output is correct
6 Correct 0 ms 208 KB Output is correct
7 Correct 0 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 208 KB Output is correct
14 Correct 1 ms 208 KB Output is correct
15 Correct 0 ms 208 KB Output is correct
16 Correct 162 ms 208 KB Output is correct
17 Correct 123 ms 208 KB Output is correct
18 Correct 153 ms 208 KB Output is correct
19 Correct 129 ms 208 KB Output is correct
20 Correct 152 ms 208 KB Output is correct
21 Correct 0 ms 208 KB Output is correct
22 Correct 0 ms 208 KB Output is correct
23 Correct 0 ms 208 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 0 ms 208 KB Output is correct
26 Correct 144 ms 208 KB Output is correct
27 Correct 0 ms 208 KB Output is correct
28 Correct 0 ms 208 KB Output is correct
29 Correct 1 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 101 ms 208 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 0 ms 208 KB Output is correct
6 Correct 0 ms 208 KB Output is correct
7 Correct 0 ms 208 KB Output is correct
8 Correct 1 ms 208 KB Output is correct
9 Correct 0 ms 208 KB Output is correct
10 Correct 0 ms 208 KB Output is correct
11 Correct 1 ms 208 KB Output is correct
12 Correct 0 ms 208 KB Output is correct
13 Correct 1 ms 208 KB Output is correct
14 Correct 1 ms 208 KB Output is correct
15 Correct 0 ms 208 KB Output is correct
16 Correct 162 ms 208 KB Output is correct
17 Correct 123 ms 208 KB Output is correct
18 Correct 153 ms 208 KB Output is correct
19 Correct 129 ms 208 KB Output is correct
20 Correct 152 ms 208 KB Output is correct
21 Correct 0 ms 208 KB Output is correct
22 Correct 0 ms 208 KB Output is correct
23 Correct 0 ms 208 KB Output is correct
24 Correct 1 ms 208 KB Output is correct
25 Correct 0 ms 208 KB Output is correct
26 Correct 144 ms 208 KB Output is correct
27 Correct 0 ms 208 KB Output is correct
28 Correct 0 ms 208 KB Output is correct
29 Correct 1 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 101 ms 208 KB Output is correct
33 Incorrect 0 ms 208 KB Wrong Answer [3]
34 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 208 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -