Submission #339557

# Submission time Handle Problem Language Result Execution time Memory
339557 2020-12-25T15:54:36 Z fixikmila Xoractive (IZhO19_xoractive) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include<interactive.h>
#include<grader.cpp>
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;
}

int *guess(int n){
    int a[4];
    a[0]=ask(1);
    a[1]=ask(2);
    a[2]=ask(3);
    a[3]=ask(4);
    return a;
}

Compilation message

Xoractive.cpp:18:6: error: ambiguating new declaration of 'int* guess(int)'
   18 | int *guess(int n){
      |      ^~~~~
In file included from Xoractive.cpp:3:
grader.cpp:73:13: note: old declaration 'std::vector<int> guess(int)'
   73 | vector<int> guess(int n);
      |             ^~~~~
Xoractive.cpp: In function 'int* guess(int)':
Xoractive.cpp:24:12: warning: address of local variable 'a' returned [-Wreturn-local-addr]
   24 |     return a;
      |            ^
Xoractive.cpp:19:9: note: declared here
   19 |     int a[4];
      |         ^