結果
問題 | No.908 うしたぷにきあくん文字列 |
ユーザー |
![]() |
提出日時 | 2020-03-28 02:20:24 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 537 bytes |
コンパイル時間 | 2,955 ms |
コンパイル使用メモリ | 174,500 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 05:59:18 |
合計ジャッジ時間 | 3,857 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
import std; bool calc(string s) { for (int i = 0; i < s.length; i++) { if (i % 2 == 0 && s[i] == ' ') return false; if (i % 2 == 1 && s[i] != ' ') return false; } return true; } void main() { string s = read!string; writeln(calc(s) ? "Yes" : "No"); } void scan(T...)(ref T a) { string[] ss = readln.split; foreach (i, t; T) a[i] = ss[i].to!t; } T read(T)() { return readln.chomp.to!T; } T[] reads(T)() { return readln.split.to!(T[]); } alias readint = read!int; alias readints = reads!int;