Submission #180152


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();
        var a = sc.IntArray(n);
        var ans = 0;
        for (int i = 0; i < n; i++)
        {
            while (!(a[i] % 2 == 1 && a[i] % 3 != 2))
            {
                a[i]--;
                ans++;
            }
            Console.WriteLine(a[i]);
            
        }
        Console.WriteLine(ans);
        
#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 B - 花占い
User camypaper
Language C# (Mono 2.10.8.1)
Score 0
Code Size 3503 Byte
Status WA
Exec Time 375 ms
Memory 8744 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
WA × 18
Set Name Test Cases
All test_1.txt, test_112358.txt, test_1379137913.txt, test_1414213562.txt, test_1732151817.txt, test_2.txt, test_2236167977.txt, test_2645751311.txt, test_3.txt, test_3141592653.txt, test_4.txt, test_5.txt, test_6.txt, test_6666666666.txt, test_7.txt, test_73.txt, test_8.txt, test_9.txt
Case Name Status Exec Time Memory
sample_01.txt WA 170 ms 8676 KB
sample_02.txt WA 182 ms 8684 KB
test_1.txt WA 182 ms 8688 KB
test_112358.txt WA 187 ms 8744 KB
test_1379137913.txt WA 191 ms 8616 KB
test_1414213562.txt WA 210 ms 8676 KB
test_1732151817.txt WA 172 ms 8684 KB
test_2.txt WA 192 ms 8672 KB
test_2236167977.txt WA 178 ms 8716 KB
test_2645751311.txt WA 173 ms 8676 KB
test_3.txt WA 185 ms 8680 KB
test_3141592653.txt WA 236 ms 8676 KB
test_4.txt WA 375 ms 8736 KB
test_5.txt WA 228 ms 8676 KB
test_6.txt WA 211 ms 8608 KB
test_6666666666.txt WA 183 ms 8672 KB
test_7.txt WA 205 ms 8676 KB
test_73.txt WA 203 ms 8608 KB
test_8.txt WA 185 ms 8676 KB
test_9.txt WA 191 ms 8652 KB