{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"PLAIN","content":"Có N thành phố và M con đường 1 chiều.\nĐường thứ i đi từ thành phố A_i đến B_i.\nBạn định lên kế hoạch để bắt đầu từ một thành phố, đi qua một số con đường và kết thúc ở thành phố nào đó.\nHỏi có bao nhiêu cặp thành phố khởi đầu và thành phố kết thúc phân biệt có thể là bản kế hoạch của bạn ?"}},{"title":"Constraints","value":{"format":"PLAIN","content":"Giới hạn:\n2 \u003c\u003d N \u003c\u003d 2000\n0 \u003c\u003d M \u003c\u003d min(2000, N(N - 1))\n1 \u003c\u003d A_i, B_i \u003c\u003d N\nA_i !\u003d B_i"}},{"title":"Input","value":{"format":"PLAIN","content":"Dữ liệu đầu vào có dạng:\nN M\nA_1 B_1\n...\nA_M B_M"}},{"title":"Output","value":{"format":"PLAIN","content":"In ra đáp án là số nguyên"}},{"title":"Sample Input 1","value":{"format":"PLAIN","content":"3 3\n1 2\n2 3\n3 2\n"}},{"title":"Sample Output 1","value":{"format":"PLAIN","content":"7"}},{"title":"Sample Input 2","value":{"format":"PLAIN","content":"3 0\n"}},{"title":"Sample Output 2","value":{"format":"PLAIN","content":"3"}},{"title":"Sample Input 3","value":{"format":"PLAIN","content":"4 4\n1 2\n2 3\n3 4\n4 1\n"}},{"title":"Sample Output 3","value":{"format":"PLAIN","content":"16"}}]}