Submission #111596


Source Code Expand

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Numerics;
using System.Text;

public class Program {
    // BEGIN CUT HERE
    public static void Main(string[] args) {
        int N, M;
        var array = Console.ReadLine().Split().Select(int.Parse).ToArray();
        N = array.ElementAtOrDefault(0);
        M = array.ElementAtOrDefault(1);
        var g = new bool[N, N];
        for (int i = 0; i < M; i++) {
            array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int x = array.ElementAtOrDefault(0);
            int y = array.ElementAtOrDefault(1);
            x--; y--;
            g[x, y] = g[y, x] = true;
        }
        int ans = 0;
        for (int bit = 0; bit < (1 << N); bit++) {
            var list = Enumerable.Range(0, N).Where((_, index) => ((1 << index) & bit) != 0).ToArray();
            var query = from i in list
                        from j in list
                        where i != j && !g[i, j]
                        select 1;
            if (!query.Any())
                ans = Math.Max(ans, list.Count());
        }
        Console.WriteLine(ans);
    }
    // END CUT HERE

}

Submission Info

Submission Time
Task D - 派閥
User EmK
Language C# (Mono 2.10.8.1)
Score 0
Code Size 1267 Byte
Status CE

Compile Error

./Main.cs(6,14): error CS0234: The type or namespace name `Numerics' does not exist in the namespace `System'. Are you missing an assembly reference?