Submission #5920234


Source Code Expand

Copy
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

class Program
{
    const int MOD = 1000000007;
    static void Main(string[] args)
    {
        new Program().Solve();
    }

    void Solve()
    {
        Scanner cin = new Scanner();
        int n = cin.NextInt();
        int k = cin.NextInt();

        if (k != 1)
        {
            Console.WriteLine(n - k);
        }
        else
        {
            Console.WriteLine(0);
        }
    }
}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string Next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return Next();
        i = 0;
        return s[i++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public char[] ArrayChar()
    {
        return Next().ToCharArray();
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = NextInt() + add;
        }
        return Array;
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = NextLong() + add;
        }
        return Array;
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = NextDouble() + add;
        }
        return Array;
    }
}

Submission Info

Submission Time
Task A - Ball Distribution
User mmatthew_43
Language C# (Mono 4.6.2.0)
Score 100
Code Size 2091 Byte
Status
Exec Time 21 ms
Memory 13140 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 s1.txt, s2.txt, s3.txt
All 100 / 100 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, s1.txt, s2.txt, s3.txt
Case Name Status Exec Time Memory
01.txt 21 ms 11220 KB
02.txt 20 ms 11092 KB
03.txt 20 ms 9044 KB
04.txt 20 ms 11092 KB
05.txt 20 ms 11092 KB
06.txt 20 ms 11092 KB
07.txt 20 ms 9044 KB
08.txt 20 ms 9044 KB
09.txt 20 ms 9044 KB
10.txt 20 ms 9044 KB
s1.txt 21 ms 13140 KB
s2.txt 20 ms 11092 KB
s3.txt 20 ms 11092 KB