結果

問題 No.908 うしたぷにきあくん文字列
ユーザー ei1333333ei1333333
提出日時 2019-10-18 10:48:12
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 1,221 bytes
コンパイル時間 1,643 ms
コンパイル使用メモリ 63,296 KB
実行使用メモリ 24,508 KB
最終ジャッジ日時 2023-09-07 20:58:06
合計ジャッジ時間 3,956 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
22,540 KB
testcase_01 AC 50 ms
20,496 KB
testcase_02 AC 50 ms
22,456 KB
testcase_03 AC 50 ms
22,560 KB
testcase_04 AC 49 ms
22,472 KB
testcase_05 AC 49 ms
20,368 KB
testcase_06 AC 49 ms
22,528 KB
testcase_07 AC 48 ms
18,444 KB
testcase_08 AC 50 ms
20,468 KB
testcase_09 AC 50 ms
20,496 KB
testcase_10 AC 49 ms
20,420 KB
testcase_11 AC 49 ms
18,448 KB
testcase_12 AC 49 ms
20,412 KB
testcase_13 AC 49 ms
22,564 KB
testcase_14 AC 49 ms
22,416 KB
testcase_15 AC 50 ms
20,428 KB
testcase_16 AC 49 ms
20,428 KB
testcase_17 AC 50 ms
22,540 KB
testcase_18 AC 51 ms
24,508 KB
testcase_19 AC 49 ms
20,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;

class Program
{
  Scanner cin;

  void myon()
  {
    cin = new Scanner();

    string S = cin.nextLine();
    for(int i = 0; i < S.Length; i++)
    {
      if(i % 2 == 0)
      {
        if(S[i] == ' ')
        {
          Console.WriteLine("No");
          return;
        }
      } else
      {
        if(S[i] != ' ')
        {
          Console.WriteLine("No");
          return;
        }
      }
    }
    Console.WriteLine("Yes");
  }

  static void Main(string[] args)
  {
    new Program().myon();
  }
}

class Scanner
{
  string[] s;
  int i;
  readonly char[] cs = new char[] { ' ' };

  public Scanner()
  {
    s = new string[0];
    i = 0;
  }

  public string next()
  {
    if (i < s.Length) return s[i++];
    string st = Console.ReadLine();
    while (st == "") st = Console.ReadLine();
    s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
    if (s.Length == 0) return next();
    i = 0;
    return s[i++];
  }

  public string nextLine()
  {
    return Console.ReadLine();
  }

  public int nextInt()
  {
    return int.Parse(next());
  }

  public long nextLong()
  {
    return long.Parse(next());
  }

  public double nextDouble()
  {
    return double.Parse(next());
  }
}
0