QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#198187#3307. Query on a Tree 17phenomenaWA 0ms3824kbC++111.7kb2023-10-03 08:56:232023-10-03 08:56:23

Judging History

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

  • [2023-10-03 08:56:23]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2023-10-03 08:56:23]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using i64=long long;
#define L(i,l,r) for(int i=(l);i<=(r);++i)
#define R(i,r,l) for(int i=(r);i>=(l);--i)
namespace nqio {
	const int mxbf=1<<20;
	char ib[mxbf],*p1=ib,*p2=ib,c;
	bool s;
	struct q {
		void r(char&x) {
			return x=getchar(),void();
			x=p1==p2&&(p2=(p1=ib)+fread(ib,1,mxbf,stdin),p1==p2)?EOF:*p1++;
		} q&operator>>(char&x) {
			for(r(x); x<=32; r(x));
			return *this;
		} q&operator>>(char*x) {
			for(r(*x); *x<=32; r(*x));
			while(*x>32)r(*++x);
			*x=0;
			return *this;
		} q&operator>>(string&x) {
			for(r(c); c<=32; r(c));
			x=c,r(c);
			while(c>32)x+=c,r(c);
			return *this;
		} template<typename t>q&operator>>(t&x) {
			for(r(c),s=0; !isdigit(c); r(c))s|=c==45;
			for(x=0; isdigit(c); r(c))x=x*10+(c^48);
			if(s)x=-x;
			return *this;
		}
	} qi;
	char ob[mxbf],*pp=ob,*pd=ob+mxbf,stk[64],*tp=stk;
	struct p {
		void f() {
			fwrite(ob,1,pp-ob,stdout),pp=ob;
		}~p() {
			f();
		} void w(char x) {
			if(*pp++=x,pp==pd)f();
		} p&operator<<(char x) {
			w(x);
			return *this;
		} p&operator<<(char*x) {
			while(*x)w(*x++);
			return *this;
		} p&operator<<(const char*x) {
			while(*x)w(*x++);
			return *this;
		} p&operator<<(string x) {
			for(char v:x)w(v);
			return *this;
		} template<typename t>p&operator<<(t x) {
			if(!x)return w(48),*this;
			if(x<0)w(45),x=-x;
			while(x)*tp++=48|x%10,x/=10;
			while(tp!=stk)w(*--tp);
			return *this;
		}
	} qo;
}
using nqio::qi;
using nqio::qo;

namespace yihlaushih {
	bool _114;

	bool _514;
	int _main(void) {
		fprintf(stderr,"floor memory:%.6lf MB\n",(&_114-&_514)/1024./1024.);
		int x=__lg(0);
		return 0;
	}
}
int main() {
	return yihlaushih::_main(),0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3824kb

input:

7
1 6
1 7
7 3
3 2
7 5
5 4
4
1 2
1 4
1 6
2 6 7

output:


result:

wrong answer 1st lines differ - expected: '2', found: ''