結果
問題 |
No.908 うしたぷにきあくん文字列
|
ユーザー |
![]() |
提出日時 | 2019-10-18 10:48:12 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 23 ms / 2,000 ms |
コード長 | 1,221 bytes |
コンパイル時間 | 2,404 ms |
コンパイル使用メモリ | 105,600 KB |
実行使用メモリ | 17,536 KB |
最終ジャッジ日時 | 2024-06-25 14:39:10 |
合計ジャッジ時間 | 2,220 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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()); } }