답안 #996648

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
996648 2024-06-11T03:30:42 Z ainta 마술쇼 (APIO24_show) C++17
0 / 100
2 ms 1064 KB
#include <vector>
#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;

#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
typedef long long ll;
using pii=pair<int,int>;
using vi=vc<int>;
using uint=unsigned;
using ull=unsigned long long;
using pil=pair<int,ll>;
using pli=pair<ll,int>;
using pll=pair<ll,ll>;
using t3=tuple<int,int,int>;


// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

std::vector<std::pair<int,int>> Alice(){
    mt19937 gen(1557);
    vi T;
    rng(i,1,6*666) T.pb(1000+i);
    shuffle(all(T), gen);


    int N = 1000 + 6*666;
    ll X = setN(N);

    vi Z(6);

    X--;
    rep(i,6){
        Z[i] = X%1000;
        X/=1000;
    }

    vc<pii>res;
    rng(i,2,1000){
        res.pb({1,i});
    }
    rep(i,666){
        rep(j,6){
            res.pb({Z[j]+1, T[i*6+j]});
        }
    }
    
    return res;
}
#include <vector>
#include "Bob.h"

#include <bits/stdc++.h>
using namespace std;

#define rng(i,a,b) for(int i=int(a);i<=int(b);i++)
#define rep(i,b) rng(i,0,b-1)
#define gnr(i,b,a) for(int i=int(b);i>=int(a);i--)
#define per(i,b) gnr(i,b-1,0)
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define bg begin()
#define ed end()
#define all(x) x.bg,x.ed
#define si(x) int(x.size())
template<class t> using vc=vector<t>;
template<class t> using vvc=vc<vc<t>>;
typedef long long ll;
using pii=pair<int,int>;
using vi=vc<int>;
using uint=unsigned;
using ull=unsigned long long;
using pil=pair<int,ll>;
using pli=pair<ll,int>;
using pll=pair<ll,ll>;
using t3=tuple<int,int,int>;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

long long Bob(std::vector<std::pair<int,int>> V){
    mt19937 gen(1557);
    vi T, U(5010);
    rng(i,1,6*666) T.pb(1000+i);
    shuffle(all(T), gen);

    rep(i,6*666){
        U[T[i]]=i%6;
    }
    int R[6]={0};

    for(auto [a,b]: V){
        if(a>1000){
            swap(a,b);
        }
        if(b>1000){
            R[U[b]] = a;
        }
    }
    ll s=1,t=1;
    rep(i,6){
        s += (R[i]-1)*t;
        t*=1000;
    }
    return s;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1064 KB Correct.
2 Incorrect 1 ms 808 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1064 KB Correct.
2 Incorrect 1 ms 808 KB Incorrect answer.
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 1064 KB Correct.
2 Incorrect 1 ms 808 KB Incorrect answer.
3 Halted 0 ms 0 KB -