답안 #851194

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
851194 2023-09-18T19:59:41 Z epicci23 Xoractive (IZhO19_xoractive) C++17
컴파일 오류
0 ms 0 KB
#include "interactive.h"
#include "bits/stdc++.h"
using namespace std;
#define pb push_back
#define int long long
#define sz(x) ((int)(x).size())

vector<int> guess(int n) {
	vector <int> ans(n,0);
    
    map<int,int> go;

    ans[0]=ask(1);

    for(int i=0;i<7;i++){
       vector<int> cur;
       for(int j=2;j<=n;j++){
       	  if(j>>i&1) cur.pb(j);
       }

       map<int,int> mp2,mp3;

       vector<int> gg=get_pairwise_xor(cur);

       for(int x:gg) mp2[x]++;
       
       for(int j=0;j<sz(cur);j++) mp2[0]--;

       for(auto& x:mp2) x.ss/=2;

       cur.pb(1);

       gg=get_pairwise_xor(cur);

       for(int x:gg) mp3[x]++;
       
       for(int j=0;j<sz(cur);j++) mp3[0]--;

       for(auto& x:mp3) x.ss/=2;

       for(auto x:mp2) mp3[x.ff]-=x.ss;

       for(auto x:mp3){
       	  if(x.ss){
       	  	go[x.ff^ans[0]]|=1LL<<i;
       	  }
       }
    }
    
    for(auto x:go) ans[x.ss-1]=x.ff;

	return ans;
}

Compilation message

Xoractive.cpp: In function 'std::vector<long long int> guess(long long int)':
Xoractive.cpp:23:40: error: could not convert 'cur' from 'vector<long long int>' to 'vector<int>'
   23 |        vector<int> gg=get_pairwise_xor(cur);
      |                                        ^~~
      |                                        |
      |                                        vector<long long int>
Xoractive.cpp:29:27: error: 'struct std::pair<const long long int, long long int>' has no member named 'ss'
   29 |        for(auto& x:mp2) x.ss/=2;
      |                           ^~
Xoractive.cpp:33:28: error: could not convert 'cur' from 'vector<long long int>' to 'vector<int>'
   33 |        gg=get_pairwise_xor(cur);
      |                            ^~~
      |                            |
      |                            vector<long long int>
Xoractive.cpp:39:27: error: 'struct std::pair<const long long int, long long int>' has no member named 'ss'
   39 |        for(auto& x:mp3) x.ss/=2;
      |                           ^~
Xoractive.cpp:41:30: error: 'struct std::pair<const long long int, long long int>' has no member named 'ff'
   41 |        for(auto x:mp2) mp3[x.ff]-=x.ss;
      |                              ^~
Xoractive.cpp:41:37: error: 'struct std::pair<const long long int, long long int>' has no member named 'ss'
   41 |        for(auto x:mp2) mp3[x.ff]-=x.ss;
      |                                     ^~
Xoractive.cpp:44:16: error: 'struct std::pair<const long long int, long long int>' has no member named 'ss'
   44 |           if(x.ss){
      |                ^~
Xoractive.cpp:45:17: error: 'struct std::pair<const long long int, long long int>' has no member named 'ff'
   45 |            go[x.ff^ans[0]]|=1LL<<i;
      |                 ^~
Xoractive.cpp:50:26: error: 'struct std::pair<const long long int, long long int>' has no member named 'ss'
   50 |     for(auto x:go) ans[x.ss-1]=x.ff;
      |                          ^~
Xoractive.cpp:50:34: error: 'struct std::pair<const long long int, long long int>' has no member named 'ff'
   50 |     for(auto x:go) ans[x.ss-1]=x.ff;
      |                                  ^~