結果

問題 No.138 化石のバージョン
ユーザー fujita
提出日時 2023-05-11 13:16:16
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 1,775 bytes
コンパイル時間 16,656 ms
コンパイル使用メモリ 167,864 KB
実行使用メモリ 181,984 KB
最終ジャッジ日時 2024-11-27 11:54:13
合計ジャッジ時間 18,748 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 10 WA * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (95 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
/home/judge/data/code/Main.cs(16,17): warning CS0219: 変数 'x' は割り当てられていますが、その値は使用されていません [/home/judge/data/code/main.csproj]
/home/judge/data/code/Main.cs(16,25): warning CS0219: 変数 'tencount' は割り当てられていますが、その値は使用されていません [/home/judge/data/code/main.csproj]
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.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 < list.Count.CompareTo(list2.Count); m++)
            {
                if (list[m] == list2[m])
                {
                    list.Remove(list[m]);
                    list.Remove(list2[m]);
                }
                else if(!(list[m] == list2[m]))
                {
                    break;
                }
            }


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