AOJ本の読書メモ   AOJ    次のAOJの問題へ    前のAOJの問題へ

DPL_5_K: Balls and Boxes 11


問題へのリンク

ボール入れ方に制限なし箱の中身は1つ以下箱の中身は1つ以上
区別できる区別できる123
区別できない区別できる456
区別できる区別できない789
区別できない区別できない101112


C#のソース

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("5 10");
            //1
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("200 100");
            //0
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        int[] wkArr = InputList[0].Split(' ').Select(pX => int.Parse(pX)).ToArray();
        int N = wkArr[0];
        int K = wkArr[1];

        if (N <= K) {
            Console.WriteLine(1);
        }
        else {
            Console.WriteLine(0);
        }
    }
}


解説

全部のボールを箱に入れれるか入れれないかなので
0通りか1通りになります。