結果

問題 No.138 化石のバージョン
ユーザー fujitafujita
提出日時 2023-05-11 14:45:52
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 3,435 bytes
コンパイル時間 9,010 ms
コンパイル使用メモリ 145,088 KB
実行使用メモリ 166,036 KB
最終ジャッジ日時 2023-08-18 08:51:34
合計ジャッジ時間 11,543 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
31,420 KB
testcase_01 AC 50 ms
29,264 KB
testcase_02 AC 51 ms
29,416 KB
testcase_03 AC 51 ms
29,496 KB
testcase_04 AC 50 ms
29,292 KB
testcase_05 AC 50 ms
29,608 KB
testcase_06 AC 51 ms
29,340 KB
testcase_07 AC 51 ms
29,608 KB
testcase_08 AC 52 ms
29,532 KB
testcase_09 AC 51 ms
29,292 KB
testcase_10 AC 51 ms
29,192 KB
testcase_11 AC 50 ms
29,300 KB
testcase_12 AC 50 ms
29,424 KB
testcase_13 AC 50 ms
29,296 KB
testcase_14 AC 51 ms
29,376 KB
testcase_15 AC 49 ms
29,372 KB
testcase_16 AC 47 ms
27,536 KB
testcase_17 AC 48 ms
27,740 KB
testcase_18 AC 46 ms
27,512 KB
testcase_19 AC 51 ms
31,376 KB
testcase_20 AC 50 ms
31,324 KB
testcase_21 AC 48 ms
27,512 KB
testcase_22 AC 51 ms
29,528 KB
testcase_23 AC 52 ms
29,532 KB
testcase_24 AC 51 ms
29,240 KB
testcase_25 AC 51 ms
29,296 KB
testcase_26 AC 49 ms
29,452 KB
testcase_27 AC 50 ms
29,420 KB
testcase_28 AC 51 ms
31,640 KB
testcase_29 AC 55 ms
29,404 KB
testcase_30 AC 45 ms
27,596 KB
testcase_31 AC 50 ms
29,252 KB
testcase_32 AC 51 ms
31,320 KB
testcase_33 AC 51 ms
29,444 KB
testcase_34 AC 51 ms
31,392 KB
testcase_35 AC 51 ms
166,036 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  Determining projects to restore...
  Restored /home/judge/data/code/main.csproj (in 130 ms).
.NET 向け Microsoft (R) Build Engine バージョン 17.0.0-preview-21470-01+cb055d28f
Copyright (C) Microsoft Corporation.All rights reserved.

  プレビュー版の .NET を使用しています。https://aka.ms/dotnet-core-preview をご覧ください
/home/judge/data/code/Main.cs(16,25): warning CS0219: 変数 'tencount' は割り当てられていますが、その値は使用されていません [/home/judge/data/code/main.csproj]
  main -> /home/judge/data/code/bin/Release/net6.0/main.dll
  main -> /home/judge/data/code/bin/Release/net6.0/publish/

ソースコード

diff #

using System.Collections.Generic;
using System;
using System.Drawing;
namespace yukicoder
{
    class Program
    {

        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var str = Console.ReadLine();
            
            List<char> list = new List<char>(s.Length);
            List<char> list2 = new List<char>(str.Length);
            int x = 0 , tencount = 0;

            

            for (int i = 0; i < s.Length; i++)
            {
                list.Add(s[i]);
            }

            for (int j = 0; j < str.Length; j++)
            {
                list2.Add(str[j]);
            }
           
           
            for(int m = 0; m < s.Length; m++)
            {
                if (list[x] == list2[x])
                {
                    list.Remove(list[x]);
                    list2.Remove(list2[x]);
                    
                }
                else if(!(list[x] == list2[x]))
                {
                    break;
                }
            }

            if (list.Count == 1 && list2.Count == 1 && int.Parse(list[0].ToString()) > int.Parse(list2[0].ToString()))
            {
                Console.WriteLine("YES");
            }
            else if(list.Count == 1 && list2.Count == 1 && int.Parse(list[0].ToString()) < int.Parse(list2[0].ToString()))
            {
                Console.WriteLine("NO");
            }
            
            else if (list.Count == 0 && list2.Count == 0)
            {
                Console.WriteLine("YES");
            }
            else if (list.Count == 0 && list2.Count > 0)
            {
                Console.WriteLine("NO");
            }
            else if (list.Count > 0 && list2.Count == 0)
            {
                Console.WriteLine("YES");
            }
            else if(list[0].Equals("."))
            {
                Console.WriteLine("YES");
            }
            else if (list2[0].Equals("."))
            {
                Console.WriteLine("NO");
            }
            else if (list.IndexOf('.') > 0 && list2.IndexOf('.') == 0)
            {
                if (list.IndexOf('.') > list2.IndexOf('.'))
                {
                    Console.WriteLine("YES");
                }
            }
            else if (list.IndexOf('.') == 0 && list2.IndexOf('.') > 0)
            {
                if (list.IndexOf('.') < list2.IndexOf('.'))
                {
                    Console.WriteLine("NO");
                }
            }
            else if (!list[0].Equals(".") && !list2[0].Equals("."))
            {
                if (int.Parse(list[0].ToString()) < int.Parse(list2[0].ToString()))
                {
                    if (list.IndexOf('.') > list2.IndexOf('.'))
                    {
                        Console.WriteLine("YES");
                    }
                    else
                    {
                        Console.WriteLine("NO");
                    }
                }
                else if (int.Parse(list[0].ToString()) > int.Parse(list2[0].ToString()))
                {
                    if (list.IndexOf('.') < list2.IndexOf('.'))
                    {
                        Console.WriteLine("NO");
                    }
                    else
                    {
                        Console.WriteLine("YES");
                    }
                }

             }
        }
    }
}
0