QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#312308#5015. 树11d10xyCompile Error//C++14669b2024-01-23 19:44:422024-01-23 19:44:42

Judging History

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

  • [2024-01-23 19:44:42]
  • 评测
  • [2024-01-23 19:44:42]
  • 提交

answer

#include"tree.h"
#include<bits/stdc++.h>
using namespace std;
using istr=basic_string<int>;
mt19937 g(time(0));
void lnk(istr fa,istr son){
   if(fa.size()==1){
      for(int x:son)answer(fa[0],x);
      return;
   }int h=fa.size()/2;
   shuffle(begin(fa),end(fa),g);
   vec L(begin(fa),begin(fa)+h);
   map<int,array<istr,2>>qwq;
   for(int x:fa)qwq[ask(x,L)][0]+=x;
   for(int x:son)qwq[ask(x,L)-L.size()][1]+=x;
   for(auto[a,b]:qwq)if(!b.empty())lnk(a,b);
}
void solver(int n,int,int){
   int rt=g()%n+1;
   vector<istr>pos(n+1);
   for(int i=1;i<=n;i++)pos[i==rt?0:ask(i,{rt})]+=i;
   for(int i=0;!pos[i+1].empty();i++)lnk(pos[i],pos[i+1]);
}

详细

implementer.cpp: In function ‘void regduj260135279::init()’:
implementer.cpp:32:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   32 |                 scanf("%d",&n);
      |                 ~~~~~^~~~~~~~~
implementer.cpp:45:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   45 |                         scanf("%d%d",&u,&v);
      |                         ~~~~~^~~~~~~~~~~~~~
answer.code: In function ‘void lnk(istr, istr)’:
answer.code:12:4: error: ‘vec’ was not declared in this scope
   12 |    vec L(begin(fa),begin(fa)+h);
      |    ^~~
answer.code:14:27: error: ‘L’ was not declared in this scope
   14 |    for(int x:fa)qwq[ask(x,L)][0]+=x;
      |                           ^
answer.code:15:28: error: ‘L’ was not declared in this scope
   15 |    for(int x:son)qwq[ask(x,L)-L.size()][1]+=x;
      |                            ^
answer.code:16:12: warning: structured bindings only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions]
   16 |    for(auto[a,b]:qwq)if(!b.empty())lnk(a,b);
      |            ^
answer.code:16:40: error: could not convert ‘a’ from ‘std::tuple_element<0, std::pair<const int, std::array<std::__cxx11::basic_string<int>, 2> > >::type’ {aka ‘const int’} to ‘istr’ {aka ‘std::__cxx11::basic_string<int>’}
   16 |    for(auto[a,b]:qwq)if(!b.empty())lnk(a,b);
      |                                        ^
      |                                        |
      |                                        std::tuple_element<0, std::pair<const int, std::array<std::__cxx11::basic_string<int>, 2> > >::type {aka const int}