{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\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 type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"MD","content":"给一个n个点,m条边的图(无自环和重边),现需要你给每条边定一个方向,使整张图不存在大于1的路径,问是否能做到?"}},{"title":"Input","value":{"format":"MD","content":"第一行包含两个整数n和m(2≤n≤200000,n-1≤m≤200000)-顶点数和边数。\n\n接下来m行,每行包含边i:边i以一对顶点ui,vi(1≤ui,vi≤n,ui≠vi)给出。 给定图中没有重边。 \n可以确保给定图是连通图。"}},{"title":"Output","value":{"format":"MD","content":"如果不能做到,输出一个“NO”;\n否则输出“YES”,然后打印一个长度为m的二进制串,如果第i条边是ui指向vi,则第i个位置为\u00270\u0027,否则为1。(边的顺序按照输入给定的顺序)\n"}},{"title":"Example","value":{"format":"MD","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e6 5\n1 5\n2 1\n1 4\n3 1\n6 1\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003eYES\n10100\n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}},{"title":"Note","value":{"format":"MD","content":"\u003cp\u003eThe picture corresponding to the first example: \u003cimg class\u003d\"tex-graphics\" SRC\u003d\"CDN_BASE_URL/b00bc3f1bce931f46bb3ce76e05266ea?v\u003d1592001490\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003c/p\u003e\n\u003cp\u003eAnd one of possible answers: \u003cimg class\u003d\"tex-graphics\" SRC\u003d\"CDN_BASE_URL/e1c2d13d51cb68c6fe1d30c86c0c3d89?v\u003d1592001490\" style\u003d\"max-width: 100.0%;max-height: 100.0%;\"\u003e\u003c/p\u003e"}}]}