답안 #1121476

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1121476 2024-11-29T05:42:30 Z vjudge1 Flight to the Ford (BOI22_communication) C++17
0 / 100
699 ms 424 KB
#include"communication.h"
#include<bits/stdc++.h>
#define pb push_back
#define pf push_front
#define mp make_pair
#define F first
#define S second
#define ff first
#define ss second
#define str string
#define ll long long
#define ull unsigned ll
#define ld long double
#define pll pair<ll,ll>
#define plll pair<pll,ll>
#define pllll pair<pll,pll>
#define pii pair<int,int>
#define pld pair<ld,ld>
#define vl vector<ll>
#define vll vector<pll>
#define vlll vector<plll>
#define vllll vector<pllll>
#define vb vector<bool>
#define vi vector<int>
#define vii vector<pii>
#define sz(x) (ll)(x).size()
#define fr front()
#define tp top()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bk back();
#pragma GCC target( "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
using namespace std;
const ld pi=acos(-1.0);
const ll e5=1e5;
const ll e6=1e6;
const ll e9=1e9;
const ll inf=1e18;
const ll mod=1e9+7;
const ll mod2=998244353;
const ll MOD=106710087877475399;
const ll N=2e5+10;
const ll M=1e6+10;
const ld eps=1e-9;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll bpm(ll x,ll y,ll m){if(y==0)return 1%m;ll p=bpm(x,y/2,m);
if(y%2==0)return p*p%m;else return p*p%m*x%m;}
ll bp(ll x,ll y){if(y==0)return 1;ll p=bp(x,y/2);
if(y%2==0)return p*p;else return p*p*x;}
void encode(int n,int x){
    int s=5;
    while(n>0){
        while(send(0)==0 && s--);
        send(x%2);
        n/=2;
        x/=2;
    }
}
pair<int,int> decode(int n){
    int x=0;
    for(int i=0;n>0;i++){
        int s=5;
        while(receive()==0 && s--);
        x+=(receive()<<i);
        n/=2;
    }
    return {x,x};
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 7 ms 328 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 699 ms 424 KB Not correct
2 Halted 0 ms 0 KB -