結果

問題 No.682 Average
ユーザー threecoursethreecourse
提出日時 2018-05-14 16:09:04
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 62 ms / 2,000 ms
コード長 1,279 bytes
コンパイル時間 3,371 ms
コンパイル使用メモリ 106,416 KB
実行使用メモリ 24,036 KB
最終ジャッジ日時 2023-09-10 20:38:48
合計ジャッジ時間 4,974 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
19,944 KB
testcase_01 AC 59 ms
19,896 KB
testcase_02 AC 61 ms
21,848 KB
testcase_03 AC 60 ms
21,860 KB
testcase_04 AC 60 ms
19,896 KB
testcase_05 AC 61 ms
21,824 KB
testcase_06 AC 60 ms
21,796 KB
testcase_07 AC 61 ms
23,908 KB
testcase_08 AC 59 ms
19,792 KB
testcase_09 AC 62 ms
23,964 KB
testcase_10 AC 61 ms
23,808 KB
testcase_11 AC 60 ms
24,036 KB
testcase_12 AC 60 ms
21,920 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.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive.lib
{

    internal class Solution
    {
        public int A, B;

        public void Run()
        {
            var line = Input.ReadIntArray();
            A = line[0];
            B = line[1];

            int ret = 0;
            for (int i = A; i <= B; i++)
            {
                if ((A + B + i) % 3 == 0) ret++;
            }

            Console.WriteLine(ret);
        }
    }

    // libs ----------
    

    // common ----------

    internal static class Input
    {
        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}
0