Submission #339574

# Submission time Handle Problem Language Result Execution time Memory
339574 2020-12-25T16:27:21 Z fixikmila Xoractive (IZhO19_xoractive) C++14
0 / 100
1000 ms 364 KB
#include <bits/stdc++.h>
#include<interactive.h>
using namespace std;
#define MOD 1000000007
typedef long long ll;
typedef pair<ll,ll>pll;
typedef long double ld;
ll bin_pow(ll a,ll b){
    if(b==0)return 1;
    if(b%2==0){
        ll t=bin_pow(a,b/2);
        return t*t%MOD;
    }
    else return a*bin_pow(a,b-1)%MOD;
}

vector<int> guess(int n){
    vector<int>a(n);
   for(int i=0;i<=n-4;i+=2){
        int x=ask(i+1);
        a[i]=x;
        vector<int>c,y;
        c.push_back(i+1);
        c.push_back(i+2);
        c.push_back(i+3);
        c.push_back(i+4);
        y=get_pairwise_xor(c);
        do{
            int m=y.size();
            if(y[m-1]!=0||y[m-2]!=0||y[m-3]!=0)continue;
            int b=y[0]^x;
            int c=y[1]^x;
            int d=y[2]^x;
            if(y[3]==b^c&&y[4]==b^d&&y[5]==c^d){
                a[i+1]=b;
                a[i+2]=c;
                a[i+3]=d;
                break;
            }
            else continue;
        }while(next_permutation(y.begin(),y.end()));
    }
    return a;
}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:34:20: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
   34 |             if(y[3]==b^c&&y[4]==b^d&&y[5]==c^d){
Xoractive.cpp:34:31: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
   34 |             if(y[3]==b^c&&y[4]==b^d&&y[5]==c^d){
Xoractive.cpp:34:42: warning: suggest parentheses around comparison in operand of '^' [-Wparentheses]
   34 |             if(y[3]==b^c&&y[4]==b^d&&y[5]==c^d){
# Verdict Execution time Memory Grader output
1 Execution timed out 3074 ms 364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3065 ms 364 KB Time limit exceeded
2 Halted 0 ms 0 KB -