結果
問題 | No.908 うしたぷにきあくん文字列 |
ユーザー |
![]() |
提出日時 | 2019-12-17 13:27:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 458 bytes |
コンパイル時間 | 1,611 ms |
コンパイル使用メモリ | 167,048 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-02 21:24:56 |
合計ジャッジ時間 | 2,138 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); string s; getline(cin ,s); int evencount = 0; int oddcount = 0; int len = s.length(); for(int i = 0 ; i < len; i += 2) { if(islower(s[i])) { evencount++; } } for(int i = 1; i < len; i += 2) { if(s[i] == ' ') { oddcount++; } } if(oddcount + evencount == len) { cout << "Yes" << endl; }else { cout << "No" << endl; } }