結果

問題 No.908 うしたぷにきあくん文字列
ユーザー sorag
提出日時 2022-08-04 15:43:04
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 643 bytes
コンパイル時間 657 ms
コンパイル使用メモリ 72,452 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 12:20:25
合計ジャッジ時間 1,398 ms
ジャッジサーバーID
(参考情報)
judge6 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include<string>
#define ll long long
using namespace std;
int main() {
    string s;
    bool f=0,g=0;
    getline(cin,s);
    for(int i=0;i<s.length();i++){
        if((i+1)%2==1){
            if(s[i]>='a' and s[i]<='z')
            {
                f=1;
            }
            else {
                f=0;
                break;
            }
        }
        else  {
            if(s[i]==' ') g=1;
            else{
                g=0;
                break;
            }
        }
        }
    if(f and g) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
     return 0;
}
     


0