{"trustable":false,"prependHtml":"\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"我们把一个城市考虑为一个图, 街道为边, 路口为点. 路口标记为 0~N-1.\n盗贼从一个点开始逃亡, 每一分钟走一条边. \n不幸的是, 我们并不知道他逃往何处, 只能假设他每分钟都必须沿着一条边走, 不能停留但是可以反复经过. \n警官想要知道是否存在一个时刻, 盗贼可能出现在城市中的任意路口. "}},{"title":"Input","value":{"format":"HTML","content":"第一行, 整数T, 测试用例数. \n每例第一行3个整数, 点数N\u003c\u003d1e5, 边数M\u003c\u003d5e5, 起点S. 接下来M行, 每行两个数字表示一条边. \n"}},{"title":"Output","value":{"format":"HTML","content":"如果存在这样的时刻输出\"YES\", 否则\"NO\". "}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e2\n3 3 0\n0 1\n0 2\n1 2\n2 1 0\n0 1\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase 1: YES\nCase 2: NO\n\n\n\n \n \u003ci style\u003d\"font-size:1px\"\u003e \u003c/i\u003e\u003c/pre\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cpre\u003eFor the first case, just look at the table below. (YES means the thief may appear at the cross at that moment)\n\n \n \u003ccenter\u003e\n \n \u003cimg SRC\u003d\"CDN_BASE_URL/73a16866627ed2c72f8825bc9af3ff1f?v\u003d1553744789\"\u003e\n \n \u003c/center\u003e \nFor the second input, at any moment, there’s at least one cross that the thief can’t reach.\n \n \u003c/pre\u003e"}},{"title":"","value":{"format":"HTML","content":""}}]}