import std.stdio, std.string, std.conv, std.array, std.algorithm; import std.uni, std.range, std.math, std.container, std.datetime; import core.bitop; immutable long MOD = 1_000_000_007; void main(){ char[] buf; readln(buf); auto input = buf.split.to!(int[]); auto N = input[0], M = input[1]; auto st = new int[][](N, N); foreach(i ; 0 .. M){ readln(buf); input = buf.split.to!(int[]); auto a = input[0], b = input[1], score = input[2]; st[a][b] = score; } auto ans = bitDP(N, st); writeln(ans); } int bitDP(int N, int[][] st){ auto uni = 2^^N - 1; auto dp = new int[][](uni + 1, N); foreach(s ; 0 .. uni + 1){ foreach(v ; 0 .. N){ auto s2 = s & (uni ^ 1<