{"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":"\u003cscript type\u003d\u0027text/x-mathjax-config\u0027\u003eMathJax.Hub.Config({tex2jax: { inlineMath: [[\u0027$\u0027,\u0027$\u0027]] } }); \u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027 src\u003d\u0027https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\u0027\u003e\u003c/script\u003e\n\u003cscript type\u003d\u0027text/javascript\u0027\u003esetTimeout(function(){MathJax.Hub.Queue([\u0027Typeset\u0027, MathJax.Hub, \u0027left_view\u0027]);}, 2000);\u003c/script\u003e\n\u003cdiv class\u003d\"panel_content\"\u003e\n有向图,有重边,有自环。选中一些点,在这些点里面求两点的最短路。有2个操作,操作 \"0\" 表示标记 x 选中,如果x之前已经被选中,输出 \"ERROR! At point x\"。操作 \"1\" 表示求 x -\u003ey 的最短路,如果x或y不在选中的点里面,输出 \"ERROR! At path x to y\",如果有不存在则输出 \"No such path\",否则输出最短路的值。\n \u003cbr\u003e \n\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"多组输入输出, N \u003d M \u003d Q \u003d 0,结束\n\u003cbr\u003e N 个点(0,1, ...,n-1),M条有向边, Q组询问( N\u003c\u003d300, M \u003c\u003d 10000, Q \u003c\u003d 100000)\n\u003cbr\u003e 接下来 M 行,描述每一条有向边 u--\u003ev 边权为 w\n\u003cbr\u003e 接下来Q行,描述每一组操作(如题目描述)\n\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"同题目描述\n\u003cbr\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cpre\u003e5 10 10\n1 2 6335\n0 4 5725\n3 3 6963\n4 0 8146\n1 2 9962\n1 0 1943\n2 1 2392\n4 2 154\n2 2 7422\n1 3 9896\n0 1\n0 3\n0 2\n0 4\n0 4\n0 1\n1 3 3\n1 1 1\n0 3\n0 4\n0 0 0\u003c/pre\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cpre\u003eCase 1:\nERROR! At point 4\nERROR! At point 1\n0\n0\nERROR! At point 3\nERROR! At point 4\u003c/pre\u003e"}}]}