結果
問題 | No.908 うしたぷにきあくん文字列 |
ユーザー |
|
提出日時 | 2019-10-18 23:08:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 1,469 bytes |
コンパイル時間 | 1,042 ms |
コンパイル使用メモリ | 110,244 KB |
最終ジャッジ日時 | 2025-01-07 23:40:57 |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:54:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 54 | scanf("%c", &c); | ~~~~~^~~~~~~~~~
ソースコード
#include <unordered_map>#include <functional>#include <algorithm>#include <iostream>#include <complex>#include <cstring>#include <string>#include <vector>#include <queue>#include <tuple>#include <set>#include <map>#define FOR0(var, max) for (ul (var) = 0; (var) < (max); ++(var))#define FORi(var, min, max) for (ul (var) = (min); (var) < (max); ++(var))#define FORi_INV(var, min, max) for (ul (var) = (max) - 1; (var) + 1 > (min); --(var))#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))using namespace std;using uc = unsigned char;using ui = unsigned int;using ul = unsigned long long int;using sc = signed char;using si = signed int;using sl = signed long long int;const static ui NMAX = 100;static ui N;static sc S[NMAX];void solve(void) {FOR0(i, N) {if (((i % 2) == 0 && !LELE('a', S[i], 'z')) || ((i % 2) == 1 && S[i] != ' ')) {cout << "No" << endl;return;}}cout << "Yes" << endl;}int main(void) {sc c;N = 0;while (1) {scanf("%c", &c);if (c == '\n') {break;}S[N] = c;N++;}solve();return 0;}