QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#73978#1176. BinomialwrzhCompile Error//C++14858b2023-01-30 02:58:532023-01-30 02:58:54

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-30 02:58:54]
  • 评测
  • [2023-01-30 02:58:53]
  • 提交

answer

using namespace std;
const ll maxnum=(1<<maxb);
ll ans;
ll arr[maxn];
ll f[maxnum];
ll t;
ll n;
void init()
{
    for(int i=0;i<maxnum;i++)
    {
        f[i]=0;
    }
    ans=0;
}
int main()
{
    scanf("%lld",&t);
    while(t--)
    {
        scanf("%lld",&n);
        init();
        for(int i=0;i<n;i++)
        {
            scanf("%lld",&arr[i]);
            f[arr[i]]++;
        }
        for(int i=0;i<maxb;i++)
        {
            for(int j=0;j<maxnum;j++)
            {
                if(j&(1<<i))
                {
                    f[j]+=f[j^(1<<i)];
                }
                else
                {
                    continue;
                }
            }
        }
        for(int i=0;i<n;i++)
        {
            ans+=f[arr[i]];
        }
        printf("%lld\n",ans);
    }
}

Details

answer.code:2:7: error: ‘ll’ does not name a type
    2 | const ll maxnum=(1<<maxb);
      |       ^~
answer.code:3:1: error: ‘ll’ does not name a type
    3 | ll ans;
      | ^~
answer.code:4:1: error: ‘ll’ does not name a type
    4 | ll arr[maxn];
      | ^~
answer.code:5:1: error: ‘ll’ does not name a type
    5 | ll f[maxnum];
      | ^~
answer.code:6:1: error: ‘ll’ does not name a type
    6 | ll t;
      | ^~
answer.code:7:1: error: ‘ll’ does not name a type
    7 | ll n;
      | ^~
answer.code: In function ‘void init()’:
answer.code:10:19: error: ‘maxnum’ was not declared in this scope
   10 |     for(int i=0;i<maxnum;i++)
      |                   ^~~~~~
answer.code:12:9: error: ‘f’ was not declared in this scope
   12 |         f[i]=0;
      |         ^
answer.code:14:5: error: ‘ans’ was not declared in this scope
   14 |     ans=0;
      |     ^~~
answer.code: In function ‘int main()’:
answer.code:18:19: error: ‘t’ was not declared in this scope
   18 |     scanf("%lld",&t);
      |                   ^
answer.code:18:5: error: ‘scanf’ was not declared in this scope
   18 |     scanf("%lld",&t);
      |     ^~~~~
answer.code:21:23: error: ‘n’ was not declared in this scope
   21 |         scanf("%lld",&n);
      |                       ^
answer.code:25:27: error: ‘arr’ was not declared in this scope
   25 |             scanf("%lld",&arr[i]);
      |                           ^~~
answer.code:26:13: error: ‘f’ was not declared in this scope
   26 |             f[arr[i]]++;
      |             ^
answer.code:28:23: error: ‘maxb’ was not declared in this scope
   28 |         for(int i=0;i<maxb;i++)
      |                       ^~~~
answer.code:30:27: error: ‘maxnum’ was not declared in this scope
   30 |             for(int j=0;j<maxnum;j++)
      |                           ^~~~~~
answer.code:34:21: error: ‘f’ was not declared in this scope
   34 |                     f[j]+=f[j^(1<<i)];
      |                     ^
answer.code:44:13: error: ‘ans’ was not declared in this scope
   44 |             ans+=f[arr[i]];
      |             ^~~
answer.code:44:18: error: ‘f’ was not declared in this scope
   44 |             ans+=f[arr[i]];
      |                  ^
answer.code:44:20: error: ‘arr’ was not declared in this scope
   44 |             ans+=f[arr[i]];
      |                    ^~~
answer.code:46:25: error: ‘ans’ was not declared in this scope
   46 |         printf("%lld\n",ans);
      |                         ^~~
answer.code:46:9: error: ‘printf’ was not declared in this scope
   46 |         printf("%lld\n",ans);
      |         ^~~~~~
answer.code:1:1: note: ‘printf’ is defined in header ‘<cstdio>’; did you forget to ‘#include <cstdio>’?
  +++ |+#include <cstdio>
    1 | using namespace std;