답안 #841512

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
841512 2023-09-01T16:03:08 Z Elvin_Fritl Xoractive (IZhO19_xoractive) C++17
6 / 100
4 ms 464 KB
#include <bits/stdc++.h>
using namespace std;

    #include "interactive.h"


vector<int> guess(int n)
{

	int eded = ask(1);
	map<int,int>mm;
	for(int mask=0;mask<7;mask++)
    {
        vector<int>v;
        for(int i=2;i<=n;i++)
        {
            if(i&(1<<mask)){
                v.push_back(i);
            }
        }
        if(v.size() == 0)
        {
            continue;
        }
        vector<int> fi = get_pairwise_xor(v);
        v.push_back(1);
        vector<int> se = get_pairwise_xor(v);
        map<int,int> m;
        for(int i:fi)
        {
            m[i]--;
        }
        for(int i:se)
        {
            m[i]++;
        }
        vector<int>res;
        for(int i=0;i<se.size();i++){
            if(m[se[i]] > 0){
                mm[se[i]^eded] |= (1<<mask);
            }
        }
	}
	vector<int>res(n);
	res[0] = eded;
	for(auto [x,i]:mm){
        assert(i > 0);
        res[i-1] = x;
	}
	return res;

}

Compilation message

Xoractive.cpp: In function 'std::vector<int> guess(int)':
Xoractive.cpp:38:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   38 |         for(int i=0;i<se.size();i++){
      |                     ~^~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 208 KB Output is correct
2 Correct 0 ms 208 KB Output is correct
3 Correct 0 ms 208 KB Output is correct
4 Correct 1 ms 208 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 336 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 3 ms 360 KB Output is correct
4 Correct 3 ms 336 KB Output is correct
5 Correct 3 ms 336 KB Output is correct
6 Correct 3 ms 336 KB Output is correct
7 Correct 3 ms 360 KB Output is correct
8 Correct 3 ms 336 KB Output is correct
9 Correct 4 ms 336 KB Output is correct
10 Correct 3 ms 336 KB Output is correct
11 Correct 2 ms 336 KB Output is correct
12 Correct 3 ms 336 KB Output is correct
13 Correct 3 ms 336 KB Output is correct
14 Correct 3 ms 336 KB Output is correct
15 Correct 2 ms 336 KB Output is correct
16 Correct 3 ms 396 KB Output is correct
17 Correct 3 ms 336 KB Output is correct
18 Correct 3 ms 380 KB Output is correct
19 Correct 2 ms 336 KB Output is correct
20 Correct 3 ms 336 KB Output is correct
21 Correct 4 ms 336 KB Output is correct
22 Correct 3 ms 336 KB Output is correct
23 Correct 2 ms 336 KB Output is correct
24 Correct 4 ms 336 KB Output is correct
25 Correct 3 ms 336 KB Output is correct
26 Correct 3 ms 336 KB Output is correct
27 Runtime error 3 ms 464 KB Execution killed with signal 11
28 Halted 0 ms 0 KB -