// FROM : https://yukicoder.me/submissions/306204 // #include #include using namespace std; struct Data { int item1, item2, score; }; int main() { long long N,M; cin >> N >> M; vector scores(M); vector v(N); for (int i=0; i < N; i++) { v[i] = i; } for (long long i=0; i> d.item1 >> d.item2 >> d.score; scores[i] = d; } long long ans = 0; do { long long t = 0; for (int i = 0; i