답안 #710755

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
710755 2023-03-15T17:47:51 Z urosk Super Dango Maker (JOI22_dango3) C++17
7 / 100
4016 ms 596 KB
#include "dango3.h"
#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include "bits/stdc++.h"
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
#define ld double
#define ll int
#define llinf 100000000000000000LL // 10^17
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}

#define daj_mi_malo_vremena ios_base::sync_with_stdio(false);cerr.tie(0);cout.tie(0);cin.tie(0);

using namespace std;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll l,ll r){
    return uniform_int_distribution<ll>(l,r)(rng);
}

#define maxn 405
#define maxm 30
ll n,m;
vector<ll> v;
vector<ll> w;
bool ok[maxn*maxm];
ll ask(){
    w.clear();
    for(ll i = 1;i<=n*m;i++) if(ok[i]) w.pb(i);
    return Query(w);
}
void Solve(int N, int M) {
    n = N; m = M;
    for(ll i = 1;i<=n*m;i++) v.pb(i),ok[i] = 1;
    shuffle(all(v),rng);
    for(ll i = m;i>=1;i--){
        vector<ll> ans;
        for(ll j = 1;j<=n;j+=2){
            ll k,f;
            lol:;
            k = rnd(0,v.size()-1);
            f = rnd(0,v.size()-1);
            while(f==k) f = rnd(0,v.size()-1);
            ok[v[k]] = 0;
            ok[v[f]] = 0;
            if(ask()!=i-1){
                ok[v[k]] = 1;
                ok[v[f]] = 1;
                goto lol;
            }
            ans.pb(v[k]);
            ans.pb(v[f]);
            if(k<f) swap(k,f);
            v.erase(v.begin()+k);
            v.erase(v.begin()+f);
        }
        Answer(ans);
    }
}
/**
3 2
3 3 1 2 1 2

4 4
2 2 3 2 4 4 3 2 3 1 1 3 4 1 4 1

**/
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 300 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 262 ms 340 KB Output is correct
2 Correct 266 ms 356 KB Output is correct
3 Correct 170 ms 356 KB Output is correct
4 Correct 183 ms 356 KB Output is correct
5 Correct 297 ms 356 KB Output is correct
6 Correct 234 ms 356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1944 ms 468 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4016 ms 596 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -