Submission #174118


Source Code Expand

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

class Program
{
    static void Main()
    {
        var sc = new Scanner();
        var n = sc.Integer();
        Console.WriteLine( (n % 2 == 0) ? n / 2 : n / 2 + 1);
#if DEBUG
        Console.ReadKey(true);
#endif
    }
}

internal class Scanner
{
    readonly TextReader reader;
    string[] buffer = new string[0];
    int position;

    public char[] Separator { get; set; }
    public Scanner(TextReader reader = null, string separator = null)
    {
        if (reader == null)
            this.reader = Console.In;
        else
            this.reader = reader;
        if (string.IsNullOrEmpty(separator))
            separator = " ";
        this.Separator = separator.ToCharArray();

    }
    public string Scan()
    {
        if (this.position < this.buffer.Length)
            return this.buffer[this.position++];
        this.buffer = this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);
        this.position = 0;
        return this.buffer[this.position++];
    }

    public string[] ScanToEndLine()
    {
        if (this.position >= this.buffer.Length)
            return this.reader.ReadLine().Split(this.Separator, StringSplitOptions.RemoveEmptyEntries);
        var size = this.buffer.Length - this.position;
        var ar = new string[size];
        Array.Copy(this.buffer, position, ar, 0, size);
        return ar;

    }

    public string ScanLine()
    {
        if (this.position >= this.buffer.Length)
            return this.reader.ReadLine();
        else
        {
            var sb = new StringBuilder();
            for (; this.position < buffer.Length; this.position++)
            {
                sb.Append(this.buffer[this.position]);
                sb.Append(' ');
            }
            return sb.ToString();
        }
    }
    public string[] ScanArray(int length)
    {
        var ar = new string[length];
        for (int i = 0; i < length; i++)
        {
            ar[i] = this.Scan();
        }
        return ar;
    }

    public int Integer()
    {
        return int.Parse(this.Scan());
    }
    public long Long()
    {
        return long.Parse(this.Scan());
    }
    public double Double()
    {
        return double.Parse(this.Scan());
    }

    public int[] IntArray(int length)
    {
        var a = new int[length];
        for (int i = 0; i < length; i++)
            a[i] = this.Integer();
        return a.ToArray();
    }
    public long[] LongArray(int length)
    {
        var a = new long[length];
        for (int i = 0; i < length; i++)
            a[i] = this.Long();
        return a.ToArray();
    }
    public double[] DoubleArray(int length)
    {
        var a = new double[length];
        for (int i = 0; i < length; i++)
            a[i] = this.Double();
        return a.ToArray();
    }

}
static public partial class EnumerableEx
{
    static public string AsString(this IEnumerable<char> source)
    {
        return new string(source.ToArray());
    }
}
//*/

Submission Info

Submission Time
Task A - 引越し作業
User camypaper
Language C# (Mono 2.10.8.1)
Score 100
Code Size 3217 Byte
Status AC
Exec Time 248 ms
Memory 8492 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 22
Set Name Test Cases
All large_1000.txt, large_997.txt, large_998.txt, large_999.txt, random_148.txt, random_155.txt, random_198.txt, random_362.txt, random_403.txt, random_667.txt, random_795.txt, random_811.txt, random_85.txt, random_959.txt, small_10.txt, small_11.txt, small_3.txt, small_4.txt, small_6.txt, small_7.txt, small_8.txt, small_9.txt
Case Name Status Exec Time Memory
large_1000.txt AC 248 ms 8416 KB
large_997.txt AC 159 ms 8416 KB
large_998.txt AC 154 ms 8480 KB
large_999.txt AC 148 ms 8468 KB
random_148.txt AC 152 ms 8416 KB
random_155.txt AC 154 ms 8424 KB
random_198.txt AC 153 ms 8416 KB
random_362.txt AC 156 ms 8420 KB
random_403.txt AC 189 ms 8492 KB
random_667.txt AC 159 ms 8476 KB
random_795.txt AC 152 ms 8420 KB
random_811.txt AC 155 ms 8472 KB
random_85.txt AC 157 ms 8460 KB
random_959.txt AC 151 ms 8472 KB
sample_1.txt AC 153 ms 8480 KB
sample_2.txt AC 152 ms 8488 KB
sample_3.txt AC 156 ms 8408 KB
small_10.txt AC 157 ms 8492 KB
small_11.txt AC 151 ms 8476 KB
small_3.txt AC 157 ms 8404 KB
small_4.txt AC 156 ms 8492 KB
small_6.txt AC 152 ms 8492 KB
small_7.txt AC 150 ms 8492 KB
small_8.txt AC 165 ms 8412 KB
small_9.txt AC 151 ms 8424 KB