Submission #183259


Source Code Expand

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

class Program
{
    void Solve()
    {
        var A = reader.IntLine();
        var B = reader.IntLine();

        var ans = Enumerable.Range(0, A.Length).Sum(i => Math.Max(A[i], B[i]));
        Console.WriteLine(ans);
        Console.ReadLine();
    }


    static void Main() { new Program().Solve(); }
    static Reader reader = new Reader(Console.In);

    class Reader
    {
        private readonly TextReader reader;
        private readonly char[] separator = new char[] { ' ' };
        private readonly StringSplitOptions removeOp = StringSplitOptions.RemoveEmptyEntries;
        private string[] A = new string[0];
        private int i;

        public Reader(TextReader r) { reader = r; }
        public bool HasNext() { return Enqueue(); }
        public string String() { return Dequeue(); }
        public int Int() { return int.Parse(Dequeue()); }
        public long Long() { return long.Parse(Dequeue()); }
        public double Double() { return double.Parse(Dequeue()); }
        public int[] IntLine() { var s = Line(); return s == "" ? new int[0] : Array.ConvertAll(Split(s), int.Parse); }
        public int[] IntArray(int N) { return Enumerable.Range(0, N).Select(i => Int()).ToArray(); }
        public int[][] IntGrid(int H) { return Enumerable.Range(0, H).Select(i => IntLine()).ToArray(); }
        public string[] StringArray(int N) { return Enumerable.Range(0, N).Select(i => Line()).ToArray(); }
        public string Line() { return reader.ReadLine().Trim(); }
        private string[] Split(string s) { return s.Split(separator, removeOp); }
        private bool Enqueue()
        {
            if (i < A.Length) return true;
            string line = reader.ReadLine();
            if (line == null) return false;
            if (line == "") return Enqueue();
            A = Split(line);
            i = 0;
            return true;
        }
        private string Dequeue() { Enqueue(); return A[i++]; }
    }

}

Submission Info

Submission Time
Task A - ゴールドラッシュ
User eitaho
Language C# (Mono 2.10.8.1)
Score 100
Code Size 2109 Byte
Status AC
Exec Time 348 ms
Memory 8720 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 4
AC × 19
Set Name Test Cases
Sample subtask0_sample-01.txt, subtask0_sample-02.txt, subtask0_sample-03.txt, subtask0_sample-04.txt
All subtask0_sample-01.txt, subtask0_sample-02.txt, subtask0_sample-03.txt, subtask0_sample-04.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Case Name Status Exec Time Memory
subtask0_sample-01.txt AC 225 ms 8632 KB
subtask0_sample-02.txt AC 215 ms 8624 KB
subtask0_sample-03.txt AC 198 ms 8692 KB
subtask0_sample-04.txt AC 348 ms 8716 KB
subtask1_01.txt AC 200 ms 8636 KB
subtask1_02.txt AC 180 ms 8652 KB
subtask1_03.txt AC 173 ms 8700 KB
subtask1_04.txt AC 244 ms 8716 KB
subtask1_05.txt AC 309 ms 8716 KB
subtask1_06.txt AC 258 ms 8716 KB
subtask1_07.txt AC 202 ms 8660 KB
subtask1_08.txt AC 182 ms 8664 KB
subtask1_09.txt AC 232 ms 8660 KB
subtask1_10.txt AC 207 ms 8684 KB
subtask1_11.txt AC 207 ms 8708 KB
subtask1_12.txt AC 244 ms 8720 KB
subtask1_13.txt AC 241 ms 8652 KB
subtask1_14.txt AC 300 ms 8712 KB
subtask1_15.txt AC 231 ms 8704 KB