답안 #1066138

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1066138 2024-08-19T15:19:41 Z beaconmc How to Avoid Disqualification in 75 Easy Steps (CEOI23_avoid) C++17
0 / 100
2 ms 348 KB
#include "avoid.h"
#include <vector>
#include <bits/stdc++.h>
 
typedef int ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)
 
using namespace std;


map<vector<ll>, ll> pos;

std::pair<int, int> scout(int R, int H) {
    FOR(i,0,10){
        vector<ll> temp;
        FOR(j,1,1001){
            if (j&(1<<i)) temp.push_back(j);
        }
        send(temp);
        temp.clear();

        FOR(j,1,1001){
            if (!(j&(1<<i))) temp.push_back(j);
        }
        send(temp);
    }

    ll cnt = 20;
    FOR(i,0,10){
        FOR(j,i+1,10){
            vector<ll> temp;
            FOR(k,1,1001){
                if ((k & (1<<i)) && (k&(1<<j))){
                    temp.push_back(k);
                }
            }
            send(temp);
            temp.clear();
            pos[{i,j}] = cnt++;
        }
    }
    vector<ll>sus =  wait();

    ll xored = 0;
    bool done = false;

    ll one = 0;

    FOR(i,0,10){
        xored += (1-(sus[2*i] ^ sus[2*i+1])) * (1<<i);

        if (sus[2*i]==1 && sus[2*i+1]==1 && !done){
            one += (1<<i);
            FOR(j,0,10){
                if (i==j) continue;
                ll a = i;
                ll b = j;
                if (a>b) swap(a,b);
                if (sus[pos[{a,b}]]) one += (1<<j);
            }
            done = 1;
        }
    }

    return {one, (xored^one)};
}





# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Correct: 65 robot(s) used, 1 hour(s) passed
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
2 Correct 1 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
3 Correct 2 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
4 Correct 1 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
5 Correct 2 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
6 Correct 2 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
7 Correct 2 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
8 Correct 1 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
9 Correct 1 ms 344 KB Correct: 65 robot(s) used, 1 hour(s) passed
10 Incorrect 1 ms 344 KB Not correct
11 Halted 0 ms 0 KB -