結果

問題 No.1883 SLASH
ユーザー kenya_hobbkenya_hobb
提出日時 2022-03-25 21:23:59
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 25 ms / 2,000 ms
コード長 2,254 bytes
コンパイル時間 2,264 ms
コンパイル使用メモリ 108,228 KB
実行使用メモリ 17,920 KB
最終ジャッジ日時 2024-04-22 05:57:30
合計ジャッジ時間 3,261 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
17,664 KB
testcase_01 AC 24 ms
17,920 KB
testcase_02 AC 24 ms
17,792 KB
testcase_03 AC 24 ms
17,664 KB
testcase_04 AC 24 ms
17,664 KB
testcase_05 AC 24 ms
17,664 KB
testcase_06 AC 24 ms
17,792 KB
testcase_07 AC 23 ms
17,920 KB
testcase_08 AC 24 ms
17,664 KB
testcase_09 AC 25 ms
17,664 KB
testcase_10 AC 24 ms
17,792 KB
testcase_11 AC 24 ms
17,536 KB
testcase_12 AC 23 ms
17,920 KB
testcase_13 AC 24 ms
17,664 KB
testcase_14 AC 24 ms
17,792 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.IO;

namespace ConsoleApp1
{
    class Program
    {
        //private static int[] A = new int[200005];//MargeSort用
        //private static int[] C = new int[200005];

        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            int a = int.Parse(S[0].ToString());
            int b = int.Parse(S[1].ToString());
            int c = int.Parse(S[2].ToString());

            Console.WriteLine(Math.Max(a, Math.Max(b, c)) - Math.Min(a, Math.Min(b, c)));

        }

        static long GCD(long a, long b)//公約数 再起関数にしてみるいつか
        {
            while (a > 0 && b > 0)
            {
                if (a > b)
                    a = a % b;
                else
                    b = b % a;
            }

            if (a == 0)
                return b;
            else
                return a;
        }

        static long LCD(long a, long b)
        {
            return a / GCD(a, b) * b;
        }


        //static void MargeSort(int l, int r)//A配列とC配列(ソート後)を用意する必要あり
        //{
        //    if (r - l == 1) return;

        //    int m = (l + r) / 2;
        //    MargeSort(l, m);
        //    MargeSort(m, r);

        //    int c1 = l, c2 = m, cnt = 0;
        //    while(c1 != m || c2 != r)
        //    {
        //        if(c1 == m)
        //        {
        //            C[cnt] = A[c2];
        //            c2++;
        //        }
        //        else if(c2 == r)
        //        {
        //            C[cnt] = A[c1];
        //            c1++;
        //        }
        //        else
        //        {
        //            if (A[c1] <= A[c2])
        //            {
        //                C[cnt] = A[c1];
        //                c1++;
        //            }
        //            else
        //            {
        //                C[cnt] = A[c2];
        //                c2++;
        //            }
        //        }

        //        cnt++;

        //    }

        //    for(int i = 0; i < cnt; i++)
        //    {
        //        A[l + i] = C[i];
        //    }

        //}

    }
}
0