結果
| 問題 | No.908 うしたぷにきあくん文字列 |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2020-03-28 02:20:24 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 537 bytes |
| 記録 | |
| コンパイル時間 | 2,322 ms |
| コンパイル使用メモリ | 172,368 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-03-06 11:54:27 |
| 合計ジャッジ時間 | 2,399 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
norioc