結果

問題 No.652 E869120 and TimeZone
ユーザー AreTrashAreTrash
提出日時 2018-03-02 16:01:55
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 161 ms / 1,000 ms
コード長 1,830 bytes
コンパイル時間 3,613 ms
コンパイル使用メモリ 107,488 KB
実行使用メモリ 27,000 KB
最終ジャッジ日時 2023-09-02 05:27:31
合計ジャッジ時間 9,724 ms
ジャッジサーバーID
(参考情報)
judge12 / judge16
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
24,980 KB
testcase_01 AC 158 ms
24,904 KB
testcase_02 AC 160 ms
24,936 KB
testcase_03 AC 161 ms
25,188 KB
testcase_04 AC 159 ms
25,008 KB
testcase_05 AC 158 ms
26,844 KB
testcase_06 AC 158 ms
24,804 KB
testcase_07 AC 157 ms
24,972 KB
testcase_08 AC 160 ms
24,988 KB
testcase_09 AC 157 ms
24,944 KB
testcase_10 AC 158 ms
26,836 KB
testcase_11 AC 160 ms
24,892 KB
testcase_12 AC 158 ms
26,944 KB
testcase_13 AC 161 ms
24,796 KB
testcase_14 AC 158 ms
23,064 KB
testcase_15 AC 160 ms
25,080 KB
testcase_16 AC 161 ms
25,168 KB
testcase_17 AC 160 ms
24,748 KB
testcase_18 AC 159 ms
25,028 KB
testcase_19 AC 159 ms
26,808 KB
testcase_20 AC 159 ms
26,880 KB
testcase_21 AC 159 ms
26,824 KB
testcase_22 AC 160 ms
24,668 KB
testcase_23 AC 159 ms
24,992 KB
testcase_24 AC 160 ms
26,656 KB
testcase_25 AC 159 ms
24,864 KB
testcase_26 AC 160 ms
25,000 KB
testcase_27 AC 160 ms
26,924 KB
testcase_28 AC 160 ms
27,000 KB
testcase_29 AC 159 ms
24,908 KB
testcase_30 AC 160 ms
26,840 KB
testcase_31 AC 159 ms
26,880 KB
testcase_32 AC 159 ms
26,884 KB
testcase_33 AC 158 ms
24,800 KB
testcase_34 AC 158 ms
25,204 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.IO;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace No652
{
    public class Program
    {
        void Solve(StreamScanner ss, StreamWriter sw)
        {
            //---------------------------------
            var A = ss.Next(Int);
            var B = ss.Next(Int);
            var S = ss.Next(s => double.Parse(s.Replace("UTC", "")));
            sw.WriteLine(DateTime.Parse($"{A}:{B}").AddHours(-9 + S).ToString("HH:mm"));
            //---------------------------------
        }

        static void Main()
        {
            var ss = new StreamScanner(new StreamReader(Console.OpenStandardInput()));
            var sw = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
            new Program().Solve(ss, sw);
            sw.Flush();
        }

        static readonly Func<string, string> String = s => s;
        static readonly Func<string, int> Int = int.Parse;
        static readonly Func<string, long> Long = long.Parse;
        static readonly Func<string, double> Double = double.Parse;
    }

    public class StreamScanner
    {
        static readonly char[] Sep = {' '};
        readonly Queue<string> buffer = new Queue<string>();
        readonly TextReader textReader;

        public StreamScanner(TextReader textReader)
        {
            this.textReader = textReader;
        }

        [SuppressMessage("ReSharper", "PossibleNullReferenceException")]
        public T Next<T>(Func<string, T> parser)
        {
            if (buffer.Count != 0) return parser(buffer.Dequeue());
            var nextStrings = textReader.ReadLine().Split(Sep, StringSplitOptions.RemoveEmptyEntries);
            foreach (var nextString in nextStrings) buffer.Enqueue(nextString);
            return Next(parser);
        }
    }
}
0