結果
| 問題 |
No.908 うしたぷにきあくん文字列
|
| コンテスト | |
| ユーザー |
ajiruajiru
|
| 提出日時 | 2019-12-05 08:29:13 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 522 bytes |
| コンパイル時間 | 339 ms |
| コンパイル使用メモリ | 31,744 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-16 07:11:47 |
| 合計ジャッジ時間 | 1,027 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
#include <cstdio>
using namespace std;
int main(void) {
char str[256];
int length;
scanf("%255[^\n]%n", str, &length);
bool is_u_s_h_i_t_a_p_u_n_i_c_h_i_a_k_u_n = true;
for (int i = 0; i < length; ++i) {
if ((i + 1) % 2 == 1) {
if (str[i] < 97 || 122 < str[i])
is_u_s_h_i_t_a_p_u_n_i_c_h_i_a_k_u_n = false;
}
if ((i + 1) % 2 == 0) {
if (str[i] != 32)
is_u_s_h_i_t_a_p_u_n_i_c_h_i_a_k_u_n = false;
}
}
if (is_u_s_h_i_t_a_p_u_n_i_c_h_i_a_k_u_n) printf("Yes");
else printf("No");
return 0;
}
ajiruajiru